Documentation
¶
Index ¶
- type IPLease
- type LeaseFilter
- type NetDB
- func (n *NetDB) Close() error
- func (n *NetDB) ForceReleaseAll() (int, error)
- func (n *NetDB) ForceReleaseIP(ip string) (bool, error)
- func (n *NetDB) ForceReleaseIPs(ips []string) error
- func (n *NetDB) ForceReleaseSubnet(subnet string) (int, error)
- func (n *NetDB) GetLeasedSubnet() (netip.Prefix, error)
- func (n *NetDB) GetReservedIPs(subnet string) ([]string, error)
- func (n *NetDB) GetSubnetStatus() ([]SubnetStatus, error)
- func (n *NetDB) ListLeases(filter LeaseFilter) ([]IPLease, error)
- func (n *NetDB) ReleaseInterface(name string) error
- func (n *NetDB) ReserveInterface(prefix string) (string, error)
- func (n *NetDB) SetLeasedSubnet(prefix netip.Prefix) error
- func (n *NetDB) Subnet(cidr string) (*Subnet, error)
- type Subnet
- func (s *Subnet) Prefix() netip.Prefix
- func (s *Subnet) Release(prefix netip.Prefix) error
- func (s *Subnet) ReleaseAddr(addr netip.Addr) error
- func (s *Subnet) ReleaseSubnet(prefix netip.Prefix) error
- func (s *Subnet) Reserve() (netip.Prefix, error)
- func (s *Subnet) ReserveSpecificAddr(addr netip.Addr) error
- func (s *Subnet) ReserveSubnet(bits int, identifier string) (*Subnet, error)
- func (s *Subnet) Router() netip.Prefix
- type SubnetStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LeaseFilter ¶ added in v0.2.0
LeaseFilter specifies filters for listing IP leases.
type NetDB ¶
type NetDB struct {
// contains filtered or unexported fields
}
func (*NetDB) ForceReleaseAll ¶ added in v0.2.0
ForceReleaseAll releases all reserved IPs.
func (*NetDB) ForceReleaseIP ¶ added in v0.2.0
ForceReleaseIP releases a specific IP address regardless of its current state.
func (*NetDB) ForceReleaseIPs ¶ added in v0.2.0
ForceReleaseIPs releases a specific set of IPs in a single transaction.
func (*NetDB) ForceReleaseSubnet ¶ added in v0.2.0
ForceReleaseSubnet releases all reserved IPs in a subnet.
func (*NetDB) GetLeasedSubnet ¶ added in v0.7.0
GetLeasedSubnet returns the previously persisted flannel subnet lease, if any. Returns an invalid prefix with nil error if no lease has been saved.
func (*NetDB) GetReservedIPs ¶ added in v0.2.0
GetReservedIPs returns all reserved IP addresses, optionally filtered by subnet.
func (*NetDB) GetSubnetStatus ¶ added in v0.2.0
func (n *NetDB) GetSubnetStatus() ([]SubnetStatus, error)
GetSubnetStatus returns utilization statistics for all subnets.
func (*NetDB) ListLeases ¶ added in v0.2.0
func (n *NetDB) ListLeases(filter LeaseFilter) ([]IPLease, error)
ListLeases returns IP leases matching the given filter.
func (*NetDB) ReleaseInterface ¶
func (*NetDB) SetLeasedSubnet ¶ added in v0.7.0
SetLeasedSubnet persists the flannel subnet lease so it can be reused on restart.
type Subnet ¶
type Subnet struct {
// contains filtered or unexported fields
}
func (*Subnet) ReserveSpecificAddr ¶ added in v0.7.0
ReserveSpecificAddr reserves a specific IP address in the subnet. This is idempotent: it succeeds whether the IP is new, already reserved, or was released. Returns an error if the address is not a usable host address within the subnet.