Documentation ¶
Index ¶
- type Allocator
- func (a *Allocator) Allocate(service string) (net.IP, error)
- func (a *Allocator) AllocateFromPool(service, pool string) (net.IP, error)
- func (a *Allocator) Assign(service string, ip net.IP) error
- func (a *Allocator) IP(service string) net.IP
- func (a *Allocator) Pool(service string) string
- func (a *Allocator) SetPools(pools map[string]*config.Pool) error
- func (a *Allocator) Unassign(service string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Allocator ¶
type Allocator struct {
// contains filtered or unexported fields
}
An Allocator tracks IP address pools and allocates addresses from them.
func (*Allocator) AllocateFromPool ¶
AllocateFromPool assigns an available IP from pool to service.
func (*Allocator) IP ¶ added in v0.3.0
IP returns the IP address allocated to service, or nil if none are allocated.
func (*Allocator) Pool ¶ added in v0.3.0
Pool returns the pool from which service's IP was allocated. If service has no IP allocated, "" is returned.
Click to show internal directories.
Click to hide internal directories.