-
Notifications
You must be signed in to change notification settings - Fork 0
/
store.go
57 lines (48 loc) · 1.04 KB
/
store.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
package main
import (
"time"
pb "github.com/jrcichra/karmen/grpc"
)
type Config struct {
Events map[string]*Event
}
type Event struct {
HostName HostName
EventName EventName
Blocks []*Block
}
type Block struct {
Type BlockType
Actions []*Action
}
type Action struct {
HostName HostName
ActionName ActionName
Parameters map[ParameterName]ParameterValue
Conditions map[ConditionName]ConditionValue
Timeout time.Duration
}
type Host struct {
Online bool
Events map[string]string
Actions map[string]string
Dispatcher pb.Karmen_ActionDispatcherServer
Deallocate chan struct{}
}
type BlockType string
type ParameterName string
type ParameterValue string
type ConditionName string
type ConditionValue string
type EventName string
type ActionName string
type HostName string
type Variable string
type VariableValue string
type UUID string
type Results map[Variable]VariableValue
type State struct {
Hosts map[HostName]*Host
Events map[UUID]Results
EventStates map[UUID]map[ParameterName]ParameterValue
}