ipallocator

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 13 Imported by: 6

Documentation

Index

Constants

View Source
const (
	IPAllocatorPrefix     = "/ipalloc"
	IPAllocatorLockPrefix = "/ipalloc-lock"
)

Variables

This section is empty.

Functions

func New

func New(config *config.Config, store store.Store, locker lock.Locker) *allocator

Types

type AllocateIPOpts

type AllocateIPOpts struct {
	AddressRange string
	// If set, will try to allocate this precise IP, error if already taken
	Address string
}

type IPAllocator

type IPAllocator interface {
	AllocateIP(ctx context.Context, id string, opts AllocateIPOpts) (string, error)
	ReleaseIP(ctx context.Context, id string, address string) error
	ReleasePool(ctx context.Context, id string) error
}

type RangeAddresser

type RangeAddresser interface {
	GetAddressRange() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL