ipam

package
v0.2.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const All = "*"

Variables

This section is empty.

Functions

func CalculateCheckSum

func CalculateCheckSum(ranges []lbv1.Range) string

func LBRangesToAllocatorRangeSet

func LBRangesToAllocatorRangeSet(ranges []lbv1.Range) (allocator.RangeSet, error)

func MakeRange

func MakeRange(r *lbv1.Range) (*allocator.Range, error)

Types

type Allocator

type Allocator struct {
	*allocator.IPAllocator
	// contains filtered or unexported fields
}

func NewAllocator

func NewAllocator(name string, ranges []lbv1.Range, cache ctllbv1.IPPoolCache, client ctllbv1.IPPoolClient) (*Allocator, error)

func (*Allocator) CheckSum

func (a *Allocator) CheckSum() string

func (*Allocator) Get

func (a *Allocator) Get(id string) (*current.IPConfig, error)

func (*Allocator) Total

func (a *Allocator) Total() int64

type Matcher

type Matcher lbv1.Selector

func NewMatcher

func NewMatcher(poolSelector lbv1.Selector) *Matcher

func (*Matcher) Matches

func (m *Matcher) Matches(r *Requirement) bool

type Requirement

type Requirement struct {
	Network   string
	Project   string
	Namespace string
	Cluster   string
}

type SafeAllocatorMap

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

func NewSafeAllocatorMap

func NewSafeAllocatorMap() *SafeAllocatorMap

func (*SafeAllocatorMap) AddOrUpdate

func (s *SafeAllocatorMap) AddOrUpdate(name string, allocator *Allocator)

func (*SafeAllocatorMap) Delete

func (s *SafeAllocatorMap) Delete(name string)

func (*SafeAllocatorMap) Get

func (s *SafeAllocatorMap) Get(name string) *Allocator

type Selector

type Selector struct {
	ctllbv1.IPPoolCache
}

func NewSelector

func NewSelector(cache ctllbv1.IPPoolCache) *Selector

func (*Selector) Select

func (s *Selector) Select(r *Requirement) (*lbv1.IPPool, error)

Select returns the pool that matches the requirement. Priority: 1. the pool that matches the requirement and has the highest priority 2. the global pool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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