-
Notifications
You must be signed in to change notification settings - Fork 51
/
monitor.go
58 lines (41 loc) · 1.46 KB
/
monitor.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
package monitor
// Event represents the event picked up by the monitor.
type Event string
const (
// EventStart is the event generated when a PU starts.
EventStart Event = "start"
// EventStop is the event generated when a PU stops/dies.
EventStop Event = "stop"
// EventCreate is the event generated when a PU gets created.
EventCreate Event = "create"
// EventDestroy is the event generated when a PU is definitely removed.
EventDestroy Event = "destroy"
// EventPause is the event generated when a PU is set to pause.
EventPause Event = "pause"
// EventUnpause is the event generated when a PU is unpaused.
EventUnpause Event = "unpause"
// EventResync instructs the processors to resync
EventResync Event = "resync"
)
// A State describes the state of the PU.
type State int
const (
// StateStarted is the state of a started PU.
StateStarted State = iota + 1
// StateStopped is the state of stopped PU.
StateStopped
// StatePaused is the state of a paused PU.
StatePaused
// StateDestroyed is the state of destroyed PU.
StateDestroyed
// StateUnknwown is the state of PU in an unknown state.
StateUnknwown
)
// A SynchronizationType represents the type of synchronization job.
type SynchronizationType int
const (
// SynchronizationTypeInitial indicates the initial synchronization job.
SynchronizationTypeInitial SynchronizationType = iota + 1
// SynchronizationTypePeriodic indicates subsequent synchronization jobs.
SynchronizationTypePeriodic
)