-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtype.go
63 lines (50 loc) · 1.1 KB
/
type.go
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
59
60
61
62
63
/*
* Copyright 2024 hopeio. All rights reserved.
* Licensed under the MIT License that can be found in the LICENSE file.
* @Created by jyb
*/
package initialize
import (
"github.com/hopeio/initialize/rootconf"
"reflect"
)
type beforeInject interface {
BeforeInject()
}
type beforeInjectWithRoot interface {
BeforeInjectWithRoot(*rootconf.RootConfig)
}
type afterInject interface {
AfterInject()
}
type afterInjectWithRoot interface {
AfterInjectWithRoot(*rootconf.RootConfig)
}
type afterInjectConfig interface {
AfterInjectConfig()
}
type afterInjectConfigWithRoot interface {
AfterInjectConfigWithRoot(*rootconf.RootConfig)
}
type Config interface {
// 注入之前设置默认值
beforeInject
// 注入之后初始化
afterInject
}
type Dao interface {
beforeInject
// 注入config后执行
afterInjectConfig
// 注入dao后执行
afterInject
}
type EmbeddedPresets struct {
}
func (u *EmbeddedPresets) BeforeInject() {
}
func (u *EmbeddedPresets) AfterInjectConfig() {
}
func (u *EmbeddedPresets) AfterInject() {
}
var EmbeddedPresetsType = reflect.TypeOf((*EmbeddedPresets)(nil)).Elem()