forked from openshift/origin
/
types.go
43 lines (35 loc) · 916 Bytes
/
types.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
package api
type EventType string
const (
Added EventType = "ADDED"
Deleted EventType = "DELETED"
)
type SubnetRegistry interface {
InitSubnets() error
GetSubnets() (*[]Subnet, error)
GetSubnet(minion string) (*Subnet, error)
DeleteSubnet(minion string) error
CreateSubnet(sn string, sub *Subnet) error
WatchSubnets(receiver chan *SubnetEvent, stop chan bool) error
InitMinions() error
GetMinions() (*[]string, error)
CreateMinion(minion string, data string) error
WatchMinions(receiver chan *MinionEvent, stop chan bool) error
WriteNetworkConfig(network string, subnetLength uint) error
GetContainerNetwork() (string, error)
GetSubnetLength() (uint64, error)
CheckEtcdIsAlive(seconds uint64) bool
}
type SubnetEvent struct {
Type EventType
Minion string
Sub Subnet
}
type MinionEvent struct {
Type EventType
Minion string
}
type Subnet struct {
Minion string
Sub string
}