Versions in this module Expand all Collapse all v1 v1.7.1 Jul 15, 2020 Changes in this version + const SSLModeAllow + const SSLModeDisable + const SSLModePrefer + const SSLModeRequire + const SSLModeVerifyCA + const SSLModeVerifyFull + var ErrNoIPAvailable NoIPAvailableError + var ErrNotFound NotFoundError + func JitterDelay(_ uint, config *retry.Config) time.Duration + func NewMemory() *memory + func NewPostgresStorage(host, port, user, password, dbname string, sslmode SSLMode) (*sql, error) + type Cleanable interface + type ExtendedSQL struct + func (s ExtendedSQL) CreatePrefix(prefix Prefix) (Prefix, error) + func (s ExtendedSQL) DeletePrefix(prefix Prefix) (Prefix, error) + func (s ExtendedSQL) ReadAllPrefixes() ([]Prefix, error) + func (s ExtendedSQL) ReadPrefix(prefix string) (Prefix, error) + func (s ExtendedSQL) UpdatePrefix(prefix Prefix) (Prefix, error) + type IP struct + IP net.IP + ParentPrefix string + type Ipamer interface + AcquireChildPrefix func(parentCidr string, length int) (*Prefix, error) + AcquireIP func(prefixCidr string) (*IP, error) + AcquireSpecificIP func(prefixCidr, specificIP string) (*IP, error) + DeletePrefix func(cidr string) (*Prefix, error) + NewPrefix func(cidr string) (*Prefix, error) + PrefixFrom func(cidr string) *Prefix + PrefixesOverlapping func(existingPrefixes []string, newPrefixes []string) error + ReleaseChildPrefix func(child *Prefix) error + ReleaseIP func(ip *IP) (*Prefix, error) + ReleaseIPFromPrefix func(prefixCidr, ip string) error + func New() Ipamer + func NewWithStorage(storage Storage) Ipamer + type NoIPAvailableError struct + func (o NoIPAvailableError) Error() string + type NotFoundError struct + func (o NotFoundError) Error() string + type OptimisticLockError struct + func (o OptimisticLockError) Error() string + type Prefix struct + AvailableChildPrefixes map[string]bool + ChildPrefixLength int + Cidr string + IPs map[string]bool + ParentCidr string + func (p *Prefix) IPNet() (*net.IPNet, error) + func (p *Prefix) Network() (net.IP, error) + func (p *Prefix) String() string + func (p *Prefix) Usage() Usage + func (p Prefix) DeepCopy() *Prefix + type SSLMode string + func (s SSLMode) String() string + type Storage interface + CreatePrefix func(prefix Prefix) (Prefix, error) + DeletePrefix func(prefix Prefix) (Prefix, error) + ReadAllPrefixes func() ([]Prefix, error) + ReadPrefix func(prefix string) (Prefix, error) + UpdatePrefix func(prefix Prefix) (Prefix, error) + type StorageProvider struct + type Usage struct + AcquiredIPs uint64 + AcquiredPrefixes uint64 + AvailableIPs uint64 + AvailablePrefixes uint64 + func (u *Usage) String() string