Versions in this module Expand all Collapse all v0 v0.2.0 Jan 30, 2023 v0.1.1 Jan 29, 2023 Changes in this version + const SSLModeAllow + const SSLModeDisable + const SSLModePrefer + const SSLModeRequire + const SSLModeVerifyCA + const SSLModeVerifyFull + var ErrAlreadyAllocated AlreadyAllocatedError + var ErrNoIPAvailable NoIPAvailableError + var ErrNotFound NotFoundError + var ErrOptimisticLockError OptimisticLockError + func PrefixesOverlapping(existingPrefixes []string, newPrefixes []string) error + type AlreadyAllocatedError struct + func (o AlreadyAllocatedError) Error() string + type IP struct + IP netip.Addr + ParentPrefix string + type Ipamer interface + AcquireChildPrefix func(ctx context.Context, parentCidr string, length uint8) (*Prefix, error) + AcquireIP func(ctx context.Context, prefixCidr string) (*IP, error) + AcquireSpecificChildPrefix func(ctx context.Context, parentCidr, childCidr string) (*Prefix, error) + AcquireSpecificIP func(ctx context.Context, prefixCidr, specificIP string) (*IP, error) + DeletePrefix func(ctx context.Context, cidr string) (*Prefix, error) + Dump func(ctx context.Context) (string, error) + Load func(ctx context.Context, dump string) error + NewPrefix func(ctx context.Context, cidr string) (*Prefix, error) + PrefixFrom func(ctx context.Context, cidr string) *Prefix + ReadAllPrefixCidrs func(ctx context.Context) ([]string, error) + ReleaseChildPrefix func(ctx context.Context, child *Prefix) error + ReleaseIP func(ctx context.Context, ip *IP) (*Prefix, error) + ReleaseIPFromPrefix func(ctx context.Context, prefixCidr, ip string) error + func New() Ipamer + func NewWithStorage(storage Storage) Ipamer + type MongoConfig struct + CollectionName string + DatabaseName string + MongoClientOptions *options.ClientOptions + 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 + Cidr string + ParentCidr string + func (p *Prefix) GobDecode(buf []byte) error + func (p *Prefix) GobEncode() ([]byte, error) + func (p *Prefix) Network() (netip.Addr, error) + func (p *Prefix) String() string + func (p *Prefix) Usage() Usage + type Prefixes []Prefix + type SSLMode string + func (s SSLMode) String() string + type Storage interface + CreatePrefix func(ctx context.Context, prefix Prefix) (Prefix, error) + DeleteAllPrefixes func(ctx context.Context) error + DeletePrefix func(ctx context.Context, prefix Prefix) (Prefix, error) + Name func() string + ReadAllPrefixCidrs func(ctx context.Context) ([]string, error) + ReadAllPrefixes func(ctx context.Context) (Prefixes, error) + ReadPrefix func(ctx context.Context, prefix string) (Prefix, error) + UpdatePrefix func(ctx context.Context, prefix Prefix) (Prefix, error) + func NewConfigmap(cmName string, cacheInternally bool) Storage + func NewEtcd(ip, port string, cert, key []byte, insecureskip bool) Storage + func NewMemory() Storage + func NewMongo(ctx context.Context, config MongoConfig) (Storage, error) + func NewPostgresStorage(host, port, user, password, dbname string, sslmode SSLMode) (Storage, error) + func NewRedis(ip, port string) Storage + type Usage struct + AcquiredIPs uint64 + AcquiredPrefixes uint64 + AvailableIPs uint64 + AvailablePrefixes []string + AvailableSmallestPrefixes uint64 + func (u *Usage) String() string