generated from layer5io/layer5-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 92
/
messaging.go
39 lines (33 loc) · 1.01 KB
/
messaging.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
package broker
var (
Request ObjectType = "request-payload"
MeshSync ObjectType = "meshsync-data"
LogStreamObject ObjectType = "log-stream"
SMI ObjectType = "smi-data"
ErrorObject ObjectType = "error"
ExecInputObject ObjectType = "exec-input"
ExecOutputObject ObjectType = "exec-output"
ActiveExecObject ObjectType = "active-exec"
Add EventType = "ADDED"
Update EventType = "MODIFIED"
Delete EventType = "DELETED"
ErrorEvent EventType = "ERROR"
ReSync EventType = "RESYNC"
LogRequestEntity RequestEntity = "log-stream"
ReSyncDiscoveryEntity RequestEntity = "resync-discovery"
ExecRequestEntity RequestEntity = "exec-request"
ActiveExecEntity RequestEntity = "active-exec"
)
type ObjectType string
type EventType string
type RequestEntity string
type Message struct {
ObjectType ObjectType
EventType EventType
Request *RequestObject
Object interface{}
}
type RequestObject struct {
Entity RequestEntity
Payload interface{}
}