Documentation ¶
Index ¶
- Variables
- type ByAvailableIP
- type SelectOption
- type SelectOptions
- type SelectionPolicy
- type Switch
- type SwitchPool
- func (s *SwitchPool) Add(sw *Switch)
- func (s *SwitchPool) Block(id string)
- func (s *SwitchPool) Del(key string)
- func (s *SwitchPool) GetByID(ctx context.Context, client client.VPC, id string) (*Switch, error)
- func (s *SwitchPool) GetOne(ctx context.Context, client client.VPC, zone string, ids []string, ...) (*Switch, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIPNotEnough = errors.New("no ip left")
View Source
var ErrNoAvailableVSwitch = errors.New("no available vSwitch")
Functions ¶
This section is empty.
Types ¶
type ByAvailableIP ¶
type ByAvailableIP []Switch
func (ByAvailableIP) Len ¶
func (a ByAvailableIP) Len() int
func (ByAvailableIP) Less ¶
func (a ByAvailableIP) Less(i, j int) bool
func (ByAvailableIP) Swap ¶
func (a ByAvailableIP) Swap(i, j int)
type SelectOption ¶
type SelectOption interface { // Apply applies this configuration to the given select options. Apply(*SelectOptions) }
type SelectOptions ¶
type SelectOptions struct { IgnoreZone bool VSwitchSelectPolicy SelectionPolicy }
SelectOptions contains options for requests.
func (*SelectOptions) Apply ¶
func (o *SelectOptions) Apply(so *SelectOptions)
Apply implements SelectOption.
func (*SelectOptions) ApplyOptions ¶
func (o *SelectOptions) ApplyOptions(opts []SelectOption) *SelectOptions
ApplyOptions applies the given select options on these options
type SelectionPolicy ¶
type SelectionPolicy string
const ( VSwitchSelectionPolicyOrdered SelectionPolicy = "ordered" VSwitchSelectionPolicyRandom SelectionPolicy = "random" VSwitchSelectionPolicyMost SelectionPolicy = "most" )
VSwitch Selection Policy
type Switch ¶
type Switch struct { ID string Zone string AvailableIPCount int64 // for ipv4 IPv4CIDR string IPv6CIDR string }
Switch hole all switch info from both terway config and podNetworking
type SwitchPool ¶
type SwitchPool struct {
// contains filtered or unexported fields
}
SwitchPool contain all vSwitches
func NewSwitchPool ¶
func NewSwitchPool(size int, ttl string) (*SwitchPool, error)
NewSwitchPool create pool and set vSwitches to pool
func (*SwitchPool) Block ¶
func (s *SwitchPool) Block(id string)
Click to show internal directories.
Click to hide internal directories.