remote

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CancelFunctions = make([]context.CancelFunc, 3)

Functions

func CleanUpTrafficManagerIfRefCountIsZero

func CleanUpTrafficManagerIfRefCountIsZero(clientset *kubernetes.Clientset, namespace string)

func FromStringToDHCP

func FromStringToDHCP(str string) map[string]sets.Int

func GetAvailableIPs

func GetAvailableIPs(m map[string]sets.Int) sets.Int

func ToString

func ToString(m map[string]sets.Int) string

ToString mac address --> rent ips

func UpdateRefCount

func UpdateRefCount(clientset *kubernetes.Clientset, namespace, name string, increment int)

UpdateRefCount vendor/k8s.io/kubectl/pkg/polymorphichelpers/rollback.go:99

Types

type DHCPManager

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

func NewDHCPManager

func NewDHCPManager(client *kubernetes.Clientset, namespace string, addr *net.IPNet) *DHCPManager

func (*DHCPManager) InitDHCPIfNecessary

func (d *DHCPManager) InitDHCPIfNecessary(ctx context.Context) (*v1.ConfigMap, error)

todo optimize dhcp, using mac address, ip and deadline as unit

func (*DHCPManager) ReleaseIP

func (d *DHCPManager) ReleaseIP(ips ...int) error

func (*DHCPManager) RentIP

func (d *DHCPManager) RentIP(random bool) (*net.IPNet, error)

type DHCPRecord

type DHCPRecord struct {
	Mac      string
	IP       string
	Deadline time.Time
}

type DHCPRecordMap

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

func FromStringToMac2IP

func FromStringToMac2IP(str string) (result DHCPRecordMap)

FromStringToMac2IP Mac --> DHCPRecord

func (*DHCPRecordMap) AddMacToIPRecord

func (maps *DHCPRecordMap) AddMacToIPRecord(mac string, ip net.IP) *DHCPRecordMap

func (*DHCPRecordMap) GetIPByMac

func (maps *DHCPRecordMap) GetIPByMac(mac string) (ip string)

func (*DHCPRecordMap) ToMac2IPMap

func (maps *DHCPRecordMap) ToMac2IPMap() map[string]string

func (*DHCPRecordMap) ToString

func (maps *DHCPRecordMap) ToString() string

Jump to

Keyboard shortcuts

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