descriptor

package
v2.5.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IPAllocDescriptorName is the name of the descriptor for allocating
	// IP addresses.
	IPAllocDescriptorName = "netalloc-ip-address"
)

Variables

This section is empty.

Functions

func NewAddrAllocDescriptor

func NewAddrAllocDescriptor(log logging.PluginLogger) (descr *kvs.KVDescriptor)

NewAddrAllocDescriptor creates a new instance of IPAllocDescriptor.

Types

type IPAllocDescriptor

type IPAllocDescriptor struct {
	// contains filtered or unexported fields
}

IPAllocDescriptor just validates and parses allocated IP addresses.

func (*IPAllocDescriptor) Create

func (d *IPAllocDescriptor) Create(key string, addrAlloc *netalloc.IPAllocation) (metadata *netalloc.IPAllocMetadata, err error)

Create parses the address and stores it into the metadata.

func (*IPAllocDescriptor) Delete

func (d *IPAllocDescriptor) Delete(key string, addrAlloc *netalloc.IPAllocation, metadata *netalloc.IPAllocMetadata) (err error)

Delete is NOOP.

func (*IPAllocDescriptor) DerivedValues

func (d *IPAllocDescriptor) DerivedValues(key string, addrAlloc *netalloc.IPAllocation) (derValues []kvs.KeyValuePair)

DerivedValues derives "neighbour-gateway" key if GW is a neighbour of the interface (addresses are from the same IP network).

func (*IPAllocDescriptor) Retrieve

func (d *IPAllocDescriptor) Retrieve(correlate []adapter.IPAllocKVWithMetadata) (valid []adapter.IPAllocKVWithMetadata, err error)

Retrieve always returns what is expected to exists since Create doesn't really change anything in SB.

func (*IPAllocDescriptor) Validate

func (d *IPAllocDescriptor) Validate(key string, addrAlloc *netalloc.IPAllocation) (err error)

Validate checks if the address can be parsed.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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