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) GetIP(service string) net.IP
- func (a *Allocator) GetPool(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) GetIP ¶
GetIP returns the IP address allocated to service, or nil if none are allocated.
func (*Allocator) GetPool ¶
GetPool 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.