-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathss_generator.go
63 lines (51 loc) · 1.46 KB
/
ss_generator.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
package states
import (
am "github.com/pancsta/asyncmachine-go/pkg/machine"
)
// GeneratorStatesDef contains all the states of the Client state machine.
type GeneratorStatesDef struct {
*am.StatesBase
// pkg/states
InheritBasic string
InheritConnected string
InheritDisposed string
// pkg/*
InheritRpcWorker string
InheritNodeWorker string
// rest
Inherit string
GroupsLocal string
GroupsInherited string
Groups string
}
// GeneratorGroupsDef contains all the state groups %s state machine.
type GeneratorGroupsDef struct {
Inherit S
}
// GeneratorStruct represents all relations and properties of GeneratorStates.
var GeneratorStruct = am.Struct{
ssG.InheritBasic: {},
ssG.InheritConnected: {Add: S{ssG.GroupsInherited}},
ssG.InheritDisposed: {},
ssG.InheritRpcWorker: {},
ssG.InheritNodeWorker: {
Add: S{ssG.GroupsInherited},
Remove: S{ssG.InheritRpcWorker},
},
ssG.Inherit: {Auto: true},
ssG.GroupsLocal: {},
ssG.GroupsInherited: {},
ssG.Groups: {Auto: true},
}
// EXPORTS AND GROUPS
var (
ssG = am.NewStates(GeneratorStatesDef{})
sgG = am.NewStateGroups(GeneratorGroupsDef{
Inherit: S{ssG.InheritBasic, ssG.InheritConnected, ssG.InheritRpcWorker,
ssG.InheritNodeWorker, ssG.InheritDisposed},
})
// GeneratorStates contains all the states for the Generator machine.
GeneratorStates = ssG
// GeneratorGroups contains all the state groups for the Generator machine.
GeneratorGroups = sgG
)