-
Notifications
You must be signed in to change notification settings - Fork 51
/
interfaces.go
44 lines (30 loc) · 1.28 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
34
35
36
37
38
39
40
41
42
43
44
package supervisor
import "github.com/aporeto-inc/trireme-lib/policy"
// A Supervisor is implementing the node control plane that captures the packets.
type Supervisor interface {
// Supervise adds a new supervised processing unit.
Supervise(contextID string, puInfo *policy.PUInfo) error
// Unsupervise unsupervises the given PU
Unsupervise(contextID string) error
// Start starts the Supervisor.
Start() error
// Stop stops the Supervisor.
Stop() error
// SetTargetNetworks sets the target networks of the supervisor
SetTargetNetworks([]string) error
}
// Implementor is the interface of the implementation based on iptables, ipsets, remote etc
type Implementor interface {
// ConfigureRules
ConfigureRules(version int, contextID string, containerInfo *policy.PUInfo) error
// UpdateRules
UpdateRules(version int, contextID string, containerInfo *policy.PUInfo, oldContainerInfo *policy.PUInfo) error
// DeleteRules
DeleteRules(version int, context string, ipAddresses policy.ExtendedMap, port string, mark string, uid string, proxyPort string, proxyPortSetName string) error
// SetTargetNetworks sets the target networks of the supervisor
SetTargetNetworks([]string, []string) error
// Start initializes any defaults
Start() error
// Stop cleans up state
Stop() error
}