librarian

package
v0.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NS                = "default" // think about more than default namespace support
	CAT_CONNS         = "connections"
	CAT_VPCs          = "vpcs"
	CAT_SW_PREFIX     = "switch."
	CAT_RG_PREFIX     = "redundancy."
	VPC_VNI_OFFSET    = 100
	VPC_VNI_MAX       = (16_777_215 - VPC_VNI_OFFSET) / VPC_VNI_OFFSET * VPC_VNI_OFFSET
	PORT_CHAN_MIN     = 1
	PORT_CHAN_MAX     = 249
	LO_REQ_PREFIX_VPC = "vpc@"
	LO_REQ_PREFIX_EXT = "ext@"
)

Variables

This section is empty.

Functions

func LoWReqForExt

func LoWReqForExt(extPeeringName string) string

func LoWReqForVPC

func LoWReqForVPC(vpcPeeringName string) string

Types

type Allocator

type Allocator[Value comparable] struct {
	Values Values[Value]
}

func (*Allocator[Value]) Allocate

func (a *Allocator[Value]) Allocate(known map[string]Value, updates map[string]bool) (map[string]Value, error)

type BalancedValues

type BalancedValues[Value comparable] struct {
	// contains filtered or unexported fields
}

func NewBalancedValues

func NewBalancedValues[Value comparable](vals []Value) *BalancedValues[Value]

func (*BalancedValues[Value]) Add

func (v *BalancedValues[Value]) Add(val Value) bool

func (*BalancedValues[Value]) Next

func (v *BalancedValues[Value]) Next() (Value, error)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(cfg *meta.FabricConfig) *Manager

func (*Manager) CatalogForRedundancyGroup

func (m *Manager) CatalogForRedundancyGroup(ctx context.Context, kube client.Client, ret *agentapi.CatalogSpec, swName string, redundancy wiringapi.SwitchRedundancy, vpcs, portChanConns, idConns map[string]bool) error

func (*Manager) CatalogForSwitch

func (m *Manager) CatalogForSwitch(ctx context.Context, kube client.Client, ret *agentapi.CatalogSpec, swName string, loWorkaroundLinks []string, loWorkaroundReqs, externals, subnets map[string]bool) error

func (*Manager) UpdateConnections

func (m *Manager) UpdateConnections(ctx context.Context, kube client.Client) error

func (*Manager) UpdateVPCs

func (m *Manager) UpdateVPCs(ctx context.Context, kube client.Client) error

type NextFreeValueFromRanges

type NextFreeValueFromRanges[Value constraints.Unsigned] struct {
	// contains filtered or unexported fields
}

func NewNextFreeValueFromRanges

func NewNextFreeValueFromRanges[Value constraints.Unsigned](ranges [][2]Value, inc Value) *NextFreeValueFromRanges[Value]

func NewNextFreeValueFromVLANRanges

func NewNextFreeValueFromVLANRanges(ranges []meta.VLANRange) *NextFreeValueFromRanges[uint16]

func (*NextFreeValueFromRanges[Value]) Add

func (v *NextFreeValueFromRanges[Value]) Add(val Value) bool

func (*NextFreeValueFromRanges[Value]) Next

func (v *NextFreeValueFromRanges[Value]) Next() (Value, error)

type Values

type Values[Value comparable] interface {
	Add(Value) bool
	Next() (Value, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL