mock_interfaces

package
v3.4.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ModuleName = "mock"

ModuleName is the module name used for models of the mock ifplugin.

Variables

View Source
var (
	Interface_Type_name = map[int32]string{
		0: "UNDEFINED_TYPE",
		1: "LOOPBACK",
		2: "TAP",
	}
	Interface_Type_value = map[string]int32{
		"UNDEFINED_TYPE": 0,
		"LOOPBACK":       1,
		"TAP":            2,
	}
)

Enum value maps for Interface_Type.

View Source
var File_model_interface_proto protoreflect.FileDescriptor
View Source
var (
	ModelInterface = models.Register(&Interface{}, models.Spec{
		Module:  ModuleName,
		Version: "v1",
		Type:    "interfaces",
	})
)

Functions

func InterfaceKey

func InterfaceKey(name string) string

InterfaceKey returns the key used in NB DB to store the configuration of the given mock interface.

Types

type Interface

type Interface struct {
	Name        string         `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                                      // interface name (in our simplified example used as both logical and host name)
	Type        Interface_Type `protobuf:"varint,2,opt,name=type,proto3,enum=mock.interfaces.Interface_Type" json:"type,omitempty"` // interface type
	Enabled     bool           `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"`                               // interface admin status (UP/DOWN)
	PhysAddress string         `protobuf:"bytes,4,opt,name=phys_address,json=physAddress,proto3" json:"phys_address,omitempty"`     // interface MAC address
	// contains filtered or unexported fields
}

func (*Interface) Descriptor deprecated

func (*Interface) Descriptor() ([]byte, []int)

Deprecated: Use Interface.ProtoReflect.Descriptor instead.

func (*Interface) GetEnabled

func (x *Interface) GetEnabled() bool

func (*Interface) GetName

func (x *Interface) GetName() string

func (*Interface) GetPhysAddress

func (x *Interface) GetPhysAddress() string

func (*Interface) GetType

func (x *Interface) GetType() Interface_Type

func (*Interface) ProtoMessage

func (*Interface) ProtoMessage()

func (*Interface) ProtoReflect added in v3.3.0

func (x *Interface) ProtoReflect() protoreflect.Message

func (*Interface) Reset

func (x *Interface) Reset()

func (*Interface) String

func (x *Interface) String() string

type Interface_Type

type Interface_Type int32
const (
	Interface_UNDEFINED_TYPE Interface_Type = 0
	Interface_LOOPBACK       Interface_Type = 1
	Interface_TAP            Interface_Type = 2
)

func (Interface_Type) Descriptor added in v3.3.0

func (Interface_Type) Enum added in v3.3.0

func (x Interface_Type) Enum() *Interface_Type

func (Interface_Type) EnumDescriptor deprecated

func (Interface_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use Interface_Type.Descriptor instead.

func (Interface_Type) Number added in v3.3.0

func (Interface_Type) String

func (x Interface_Type) String() string

func (Interface_Type) Type added in v3.3.0

Jump to

Keyboard shortcuts

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