-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlifecycle_addin.go
More file actions
58 lines (49 loc) · 2.34 KB
/
lifecycle_addin.go
File metadata and controls
58 lines (49 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* This file is part of Golaxy Distributed Service Development Framework.
*
* Golaxy Distributed Service Development Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or
* (at your option) any later version.
*
* Golaxy Distributed Service Development Framework is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Golaxy Distributed Service Development Framework. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (c) 2024 pangdogs.
*/
package core
import (
"git.golaxy.org/core/runtime"
"git.golaxy.org/core/service"
)
// LifecycleAddInInit 插件初始化回调,插件实现此接口即可使用,当插件安装在服务上时,rtCtx为nil
type LifecycleAddInInit interface {
Init(svcCtx service.Context, rtCtx runtime.Context)
}
// LifecycleAddInShut 插件结束回调,插件实现此接口即可使用,当插件安装在服务上时,rtCtx为nil
type LifecycleAddInShut interface {
Shut(svcCtx service.Context, rtCtx runtime.Context)
}
// LifecycleRuntimeAddInInit 运行时插件初始化回调,当插件安装在运行时上时,实现此接口即可使用
type LifecycleRuntimeAddInInit interface {
Init(rtCtx runtime.Context)
}
// LifecycleRuntimeAddInShut 运行时插件结束回调,当插件安装在运行时上时,实现此接口即可使用
type LifecycleRuntimeAddInShut interface {
Shut(rtCtx runtime.Context)
}
// LifecycleAddInOnRuntimeRunningEvent 运行事件,当插件安装在运行时上时,实现此接口即可使用
type LifecycleAddInOnRuntimeRunningEvent = runtime.EventContextRunningEvent
// LifecycleServiceAddInInit 服务插件初始化回调,当插件安装在服务上时,实现此接口即可使用
type LifecycleServiceAddInInit interface {
Init(svcCtx service.Context)
}
// LifecycleServiceAddInShut 服务插件结束回调,当插件安装在服务上时,实现此接口即可使用
type LifecycleServiceAddInShut interface {
Shut(svcCtx service.Context)
}