descriptor

package
v2.3.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InterfaceDescriptorName is the name of the descriptor for mock interfaces.
	InterfaceDescriptorName = "mock-interface"
)

Variables

View Source
var (
	// ErrInterfaceWithoutName is returned when interface configuration has
	// undefined Name attribute.
	ErrInterfaceWithoutName = errors.New("mock interface defined without logical name")

	// ErrInterfaceNameTooLong is returned when mock interface name exceeds the length limit.
	ErrInterfaceNameTooLong = errors.New("mock interface logical name exceeds the length limit (15 characters)")

	// ErrInterfaceWithoutType is returned when mock interface configuration has undefined
	// Type attribute.
	ErrInterfaceWithoutType = errors.New("mock interface defined without type")
)

Example of some validation errors:

Functions

func NewInterfaceDescriptor

func NewInterfaceDescriptor(ifaceHandler mockcalls.MockIfaceAPI, log logging.PluginLogger) *kvs.KVDescriptor

NewInterfaceDescriptor creates a new instance of the Interface descriptor.

Types

type InterfaceDescriptor

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

InterfaceDescriptor teaches KVScheduler how to configure mock interfaces.

func (*InterfaceDescriptor) Create

func (d *InterfaceDescriptor) Create(key string, value *interfaces.Interface) (metadata *idxvpp.OnlyIndex, err error)

Create creates mock interface.

func (*InterfaceDescriptor) Delete

func (d *InterfaceDescriptor) Delete(key string, value *interfaces.Interface, metadata *idxvpp.OnlyIndex) error

Delete removes a mock interface.

func (*InterfaceDescriptor) EquivalentInterfaces

func (d *InterfaceDescriptor) EquivalentInterfaces(key string, oldIntf, newIntf *interfaces.Interface) bool

EquivalentInterfaces is case-insensitive comparison function for interfaces.Interface, also ignoring the order of assigned IP addresses.

func (*InterfaceDescriptor) MetadataFactory

func (d *InterfaceDescriptor) MetadataFactory() idxmap.NamedMappingRW

MetadataFactory is a factory for index-map customized for VPP interfaces.

func (*InterfaceDescriptor) Retrieve

func (d *InterfaceDescriptor) Retrieve(correlate []adapter.InterfaceKVWithMetadata) (retrieved []adapter.InterfaceKVWithMetadata, err error)

Retrieve returns all interfaces configured in the mock SB.

func (*InterfaceDescriptor) Update

func (d *InterfaceDescriptor) Update(key string, oldValue, newValue *interfaces.Interface, oldMetadata *idxvpp.OnlyIndex) (newMetadata *idxvpp.OnlyIndex, err error)

Update updates parameters of a mock interface.

func (*InterfaceDescriptor) UpdateWithRecreate

func (d *InterfaceDescriptor) UpdateWithRecreate(key string, oldIntf, newIntf *interfaces.Interface, metadata *idxvpp.OnlyIndex) bool

UpdateWithRecreate returns true if Type is requested to be changed.

func (*InterfaceDescriptor) Validate

func (d *InterfaceDescriptor) Validate(key string, intf *interfaces.Interface) error

Validate validates VPP interface configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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