Documentation ¶
Index ¶
- Constants
- Variables
- func NewInterfaceDescriptor(ifaceHandler mockcalls.MockIfaceAPI, log logging.PluginLogger) *kvs.KVDescriptor
- type InterfaceDescriptor
- func (d *InterfaceDescriptor) Create(key string, value *interfaces.Interface) (metadata *idxvpp.OnlyIndex, err error)
- func (d *InterfaceDescriptor) Delete(key string, value *interfaces.Interface, metadata *idxvpp.OnlyIndex) error
- func (d *InterfaceDescriptor) EquivalentInterfaces(key string, oldIntf, newIntf *interfaces.Interface) bool
- func (d *InterfaceDescriptor) MetadataFactory() idxmap.NamedMappingRW
- func (d *InterfaceDescriptor) Retrieve(correlate []adapter.InterfaceKVWithMetadata) (retrieved []adapter.InterfaceKVWithMetadata, err error)
- func (d *InterfaceDescriptor) Update(key string, oldValue, newValue *interfaces.Interface, ...) (newMetadata *idxvpp.OnlyIndex, err error)
- func (d *InterfaceDescriptor) UpdateWithRecreate(key string, oldIntf, newIntf *interfaces.Interface, metadata *idxvpp.OnlyIndex) bool
- func (d *InterfaceDescriptor) Validate(key string, intf *interfaces.Interface) error
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.
Click to show internal directories.
Click to hide internal directories.