Documentation ¶
Index ¶
- Variables
- func NewAllocator(opts ...Option) (netalloc.Allocator, error)
- type Allocator
- func (a *Allocator) Alloc() (*net.IPAddr, error)
- func (a *Allocator) AllocCIDR() (cidr string, err error)
- func (a *Allocator) CIDR(ip *net.IPAddr) string
- func (a *Allocator) Free(ip *net.IPAddr) error
- func (a *Allocator) FreeCIDR(cidr string) (err error)
- func (a *Allocator) SetStore(_ netalloc.Store)
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingPrefix = errors.New("missing prefix config") ErrMissingEndpoint = errors.New("missing endpoint config") ErrMissingToken = errors.New("missing token config") ErrPrefixNotFound = errors.New("prefix not found") ErrIPNotFound = errors.New("ip not found") ErrUnexpectedStatusCode = errors.New("unexpected status code") )
Functions ¶
Types ¶
type Option ¶
type Option func(*Allocator)
func WithEndpoint ¶
func WithHTTPClient ¶
func WithInsecureClient ¶
func WithPrefix ¶
Click to show internal directories.
Click to hide internal directories.