-
Notifications
You must be signed in to change notification settings - Fork 149
/
config.go
57 lines (43 loc) · 1.1 KB
/
config.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
package types
import (
"github.com/AliyunContainerService/terway/pkg/vswitch"
)
type ENIConfig struct {
ZoneID string
VSwitchOptions []string
ENITags map[string]string
SecurityGroupIDs []string
InstanceID string
VSwitchSelectionPolicy vswitch.SelectionPolicy
ResourceGroupID string
EniTypeAttr Feat
EnableIPv4 bool
EnableIPv6 bool
}
// PoolConfig configuration of pool and resource factory
type PoolConfig struct {
EnableIPv4 bool
EnableIPv6 bool
Capacity int // the max res can hold in the pool
MaxENI int // the max eni terway can be created (already exclude main eni)
MaxMemberENI int // the max member eni can be created
ERdmaCapacity int // the max erdma res can be created
MaxIPPerENI int
BatchSize int
MaxPoolSize int
MinPoolSize int
}
type Feat uint8
const (
FeatTrunk Feat = 1 << iota
FeatERDMA
)
func EnableFeature(features *Feat, feature Feat) {
*features |= feature
}
func DisableFeature(features *Feat, feature Feat) {
*features &= ^feature
}
func IsFeatureEnabled(features Feat, feature Feat) bool {
return features&feature != 0
}