forked from Qihoo360/wayne
-
Notifications
You must be signed in to change notification settings - Fork 1
/
event.go
46 lines (38 loc) · 1.16 KB
/
event.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
package hookevent
type HookEvent struct {
Key string `json:"key"`
Name string `json:"name"`
Description string `json:"description"`
}
var (
AllHookEvents = make(map[string]*HookEvent)
EventDeployment = &HookEvent{
Key: "deployment",
Name: "Deployment(部署)",
Description: "Related actions of \"deployment\", such as creation, online and offline, instance number adjustment, etc.",
}
EventService = &HookEvent{
Key: "service",
Name: "Service(负载均衡)",
Description: "Related actions of \"Service\", such as the above online, offline, etc.",
}
EventIngress = &HookEvent{
Key: "ingress",
Name: "Ingress",
Description: "Related actions of \"Ingress\", such as the above online, offline, etc.",
}
EventMember = &HookEvent{
Key: "member",
Name: "Member(成员)",
Description: "Monitor the additions, deletions, or changes in permissions of members of a application or namespace.",
}
)
func Registry(event *HookEvent) {
AllHookEvents[event.Key] = event
}
func init() {
Registry(EventDeployment)
Registry(EventService)
Registry(EventMember)
Registry(EventIngress)
}