Documentation
¶
Index ¶
- Variables
- type Allocator
- func (a *Allocator) Allocate(ctx context.Context, claimer *Claimer, ip netip.Addr) error
- func (a *Allocator) AllocateNext(ctx context.Context, claimer *Claimer) (netip.Addr, error)
- func (a *Allocator) DryRun() Interface
- func (a *Allocator) IPFamily() corev1.IPFamily
- func (a *Allocator) Release(ctx context.Context, claimer *Claimer, ip netip.Addr) error
- type Allocators
- func (a *Allocators) AllocateCreate(ctx context.Context, obj client.Object, dryRun bool) (Transaction, error)
- func (a *Allocators) AllocateUpdate(ctx context.Context, obj, oldObj client.Object, dryRun bool) (Transaction, error)
- func (a *Allocators) Release(ctx context.Context, obj client.Object, dryRun bool)
- type Claimer
- type Interface
- type Request
- type Requester
- type Transaction
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAllocated = errors.New("provided IP is already allocated") ErrNotFound = errors.New("provided IP was not found") )
Functions ¶
This section is empty.
Types ¶
type Allocator ¶
type Allocator struct {
// contains filtered or unexported fields
}
func New ¶
func New( scheme *runtime.Scheme, prefixes []netip.Prefix, client v1alpha1client.CoreV1alpha1Interface, informer v1alpha1informers.IPInformer, ) (*Allocator, error)
func (*Allocator) AllocateNext ¶
type Allocators ¶
type Allocators struct {
// contains filtered or unexported fields
}
func NewAllocators ¶
func (*Allocators) AllocateCreate ¶
func (a *Allocators) AllocateCreate(ctx context.Context, obj client.Object, dryRun bool) (Transaction, error)
func (*Allocators) AllocateUpdate ¶
func (a *Allocators) AllocateUpdate(ctx context.Context, obj, oldObj client.Object, dryRun bool) (Transaction, error)
type Claimer ¶ added in v0.3.0
type Claimer struct {
// Object is the claiming object.
Object client.Object
// Resource is the API resource of the claiming object.
Resource string
// ExternalVersion is the external API version to use for references.
ExternalVersion string
}
Claimer represents a claimer of an IP.
type Transaction ¶
type Transaction interface {
Commit()
Revert()
}
Click to show internal directories.
Click to hide internal directories.