-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand.go
46 lines (39 loc) · 1.1 KB
/
command.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 go_system_api
import "time"
type CommandStep struct {
CommandName string `json:"command_name"`
Args string `json:"args"`
Url string `json:"url"`
}
type CommandList struct {
QueryId string `json:"query_id"`
Commands []CommandStep `json:"commands"`
Step int `json:"step"`
ErrorUrl string `json:"error_url"`
}
type EventData struct {
Raw *string `json:"raw"`
IndexTime *time.Time `json:"index_time"`
TimeStamp *time.Time `json:"time_stamp"`
EventType *string `json:"event_type"`
Category *string `json:"category"`
Derived map[string]interface{} `json:"derived"`
}
func NewEmptyData() EventData {
return EventData{
Raw: nil,
IndexTime: nil,
TimeStamp: nil,
EventType: nil,
Category: nil,
Derived: make(map[string]interface{}),
}
}
type ProcessingEvent struct {
Commands CommandList `json:"commands"`
Event EventData `json:"event"`
}
type BatchProcessingEvent struct {
Commands CommandList `json:"commands"`
Events []EventData `json:"event"`
}