Documentation ¶
Index ¶
- Constants
- Variables
- func InterfaceKey(name string) string
- type Interface
- func (*Interface) Descriptor() ([]byte, []int)deprecated
- func (x *Interface) GetEnabled() bool
- func (x *Interface) GetName() string
- func (x *Interface) GetPhysAddress() string
- func (x *Interface) GetType() Interface_Type
- func (*Interface) ProtoMessage()
- func (x *Interface) ProtoReflect() protoreflect.Message
- func (x *Interface) Reset()
- func (x *Interface) String() string
- type Interface_Type
- func (Interface_Type) Descriptor() protoreflect.EnumDescriptor
- func (x Interface_Type) Enum() *Interface_Type
- func (Interface_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x Interface_Type) Number() protoreflect.EnumNumber
- func (x Interface_Type) String() string
- func (Interface_Type) Type() protoreflect.EnumType
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 ¶
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) GetEnabled ¶
func (*Interface) GetPhysAddress ¶
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
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) Descriptor() protoreflect.EnumDescriptor
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 (x Interface_Type) Number() protoreflect.EnumNumber
func (Interface_Type) String ¶
func (x Interface_Type) String() string
func (Interface_Type) Type ¶ added in v3.3.0
func (Interface_Type) Type() protoreflect.EnumType
Click to show internal directories.
Click to hide internal directories.