-
Notifications
You must be signed in to change notification settings - Fork 51
/
interfaces.go
33 lines (23 loc) · 1.09 KB
/
interfaces.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
package monitor
import "github.com/aporeto-inc/trireme/policy"
// A Monitor is the interface to implement low level monitoring functions on some well defined primitive.
type Monitor interface {
// Start starts the monitor.
Start() error
// Stop Stops the monitor.
Stop() error
}
// A ProcessingUnitsHandler is responsible for monitoring creation and deletion of ProcessingUnits.
type ProcessingUnitsHandler interface {
// SetPURuntime handles the create ProcessingUnit event.
SetPURuntime(contextID string, runtimeInfo *policy.PURuntime) error
// HandlePUEvent handles the event generated by the PU.
HandlePUEvent(contextID string, event Event) error
}
// A SynchronizationHandler can handle a PU synchronization routine.
type SynchronizationHandler interface {
// HandleSynchronization handles a synchronization routine.
HandleSynchronization(contextID string, state State, RuntimeReader policy.RuntimeReader, syncType SynchronizationType) error
// HandleSynchronizationComplete is called when a synchronization job is complete.
HandleSynchronizationComplete(syncType SynchronizationType)
}