Documentation
¶
Overview ¶
Package ovsutils is a generated GoMock package.
Package ovsutils is a generated GoMock package.
Package ovsutils is a generated GoMock package.
Index ¶
- Constants
- Variables
- type API
- type BridgeConfig
- type Client
- func (c *Client) AddBridge(ctx context.Context, bridgeConfig BridgeConfig) error
- func (c *Client) AddPort(ctx context.Context, portConfig PortConfig) error
- func (c *Client) DelPort(ctx context.Context, bridgeName, portName string, opt *DelPortOpt) error
- func (c *Client) DeleteBridge(ctx context.Context, name string) error
- func (c *Client) GetBridgeNameByInterface(ctx context.Context, name string) (string, error)
- func (c *Client) GetBridgeNameByPort(ctx context.Context, name string) (string, error)
- func (c *Client) GetBridgeWithName(ctx context.Context, name string) (*ovsmodel.Bridge, error)
- func (c *Client) GetIfaceWithExternalIDs(ctx context.Context, externalIDs map[string]string) (*ovsmodel.Interface, error)
- func (c *Client) GetIfaceWithName(ctx context.Context, name string) (*ovsmodel.Interface, error)
- func (c *Client) GetInterfaceLinkState(ctx context.Context, name string) (ovsmodel.InterfaceLinkState, error)
- func (c *Client) GetOpenVSwitch(ctx context.Context) (*ovsmodel.OpenvSwitch, error)
- func (c *Client) GetOpenVSwitchExternalIDs(ctx context.Context) (map[string]string, error)
- func (c *Client) GetPortVLANState(ctx context.Context, name string) (PortVLANState, error)
- func (c *Client) IsIfaceInBr(ctx context.Context, bridgeName, portName string) (bool, error)
- func (c *Client) ListBridgesWithExternalIDs(ctx context.Context, externalIDs map[string]string) ([]ovsmodel.Bridge, error)
- func (c *Client) ListInterfacesWithError(ctx context.Context) ([]string, error)
- func (c *Client) SetBridgeExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
- func (c *Client) SetBridgeOtherConfig(ctx context.Context, name string, otherConfig map[string]string) error
- func (c *Client) SetIfaceExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
- func (c *Client) SetIfaceOptions(ctx context.Context, name string, options map[string]string) error
- func (c *Client) SetOpenVSwitchExternalIDs(ctx context.Context, externalIDs map[string]string) error
- func (c *Client) SetPortExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
- func (c *Client) ValidateBridgeExists(ctx context.Context, bridgeName string) error
- type DelPortOpt
- type MockAPI
- func (m *MockAPI) AddBridge(ctx context.Context, bridgeConfig BridgeConfig) error
- func (m *MockAPI) AddPort(ctx context.Context, portConfig PortConfig) error
- func (m *MockAPI) Cache() *cache.TableCache
- func (m *MockAPI) Close()
- func (m *MockAPI) Connect(arg0 context.Context) error
- func (m *MockAPI) Connected() bool
- func (m *MockAPI) Create(arg0 ...model.Model) ([]ovsdb.Operation, error)
- func (m *MockAPI) CurrentEndpoint() string
- func (m *MockAPI) DelPort(ctx context.Context, bridgeName, portName string, opt *DelPortOpt) error
- func (m *MockAPI) DeleteBridge(ctx context.Context, name string) error
- func (m *MockAPI) Disconnect()
- func (m *MockAPI) DisconnectNotify() chan struct{}
- func (m *MockAPI) EXPECT() *MockAPIMockRecorder
- func (m *MockAPI) Echo(arg0 context.Context) error
- func (m *MockAPI) Get(arg0 context.Context, arg1 model.Model) error
- func (m *MockAPI) GetBridgeNameByInterface(ctx context.Context, name string) (string, error)
- func (m *MockAPI) GetBridgeNameByPort(ctx context.Context, name string) (string, error)
- func (m *MockAPI) GetBridgeWithName(ctx context.Context, name string) (*ovsmodel.Bridge, error)
- func (m *MockAPI) GetIfaceWithExternalIDs(ctx context.Context, externalIDs map[string]string) (*ovsmodel.Interface, error)
- func (m *MockAPI) GetIfaceWithName(ctx context.Context, name string) (*ovsmodel.Interface, error)
- func (m *MockAPI) GetInterfaceLinkState(ctx context.Context, name string) (ovsmodel.InterfaceLinkState, error)
- func (m *MockAPI) GetOpenVSwitchExternalIDs(ctx context.Context) (map[string]string, error)
- func (m *MockAPI) GetPortVLANState(ctx context.Context, name string) (PortVLANState, error)
- func (m *MockAPI) IsIfaceInBr(ctx context.Context, bridgeName, portName string) (bool, error)
- func (m *MockAPI) List(ctx context.Context, result any) error
- func (m *MockAPI) ListBridgesWithExternalIDs(ctx context.Context, externalIDs map[string]string) ([]ovsmodel.Bridge, error)
- func (m *MockAPI) ListInterfacesWithError(ctx context.Context) ([]string, error)
- func (m *MockAPI) Monitor(arg0 context.Context, arg1 *client.Monitor) (client.MonitorCookie, error)
- func (m *MockAPI) MonitorAll(arg0 context.Context) (client.MonitorCookie, error)
- func (m *MockAPI) MonitorCancel(ctx context.Context, cookie client.MonitorCookie) error
- func (m *MockAPI) NewMonitor(arg0 ...client.MonitorOption) *client.Monitor
- func (m *MockAPI) Schema() ovsdb.DatabaseSchema
- func (m *MockAPI) SetBridgeExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
- func (m *MockAPI) SetIfaceExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
- func (m *MockAPI) SetIfaceOptions(ctx context.Context, name string, options map[string]string) error
- func (m *MockAPI) SetOpenVSwitchExternalIDs(ctx context.Context, externalIDs map[string]string) error
- func (m *MockAPI) SetOption(arg0 client.Option) error
- func (m *MockAPI) SetPortExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
- func (m *MockAPI) Transact(arg0 context.Context, arg1 ...ovsdb.Operation) ([]ovsdb.OperationResult, error)
- func (m *MockAPI) UpdateEndpoints(arg0 []string)
- func (m *MockAPI) ValidateBridgeExists(ctx context.Context, bridgeName string) error
- func (m *MockAPI) Where(arg0 ...model.Model) client.ConditionalAPI
- func (m *MockAPI) WhereAll(arg0 model.Model, arg1 ...model.Condition) client.ConditionalAPI
- func (m *MockAPI) WhereAny(arg0 model.Model, arg1 ...model.Condition) client.ConditionalAPI
- func (m *MockAPI) WhereCache(predicate any) client.ConditionalAPI
- type MockAPIMockRecorder
- func (mr *MockAPIMockRecorder) AddBridge(ctx, bridgeConfig any) *gomock.Call
- func (mr *MockAPIMockRecorder) AddPort(ctx, portConfig any) *gomock.Call
- func (mr *MockAPIMockRecorder) Cache() *gomock.Call
- func (mr *MockAPIMockRecorder) Close() *gomock.Call
- func (mr *MockAPIMockRecorder) Connect(arg0 any) *gomock.Call
- func (mr *MockAPIMockRecorder) Connected() *gomock.Call
- func (mr *MockAPIMockRecorder) Create(arg0 ...any) *gomock.Call
- func (mr *MockAPIMockRecorder) CurrentEndpoint() *gomock.Call
- func (mr *MockAPIMockRecorder) DelPort(ctx, bridgeName, portName, opt any) *gomock.Call
- func (mr *MockAPIMockRecorder) DeleteBridge(ctx, name any) *gomock.Call
- func (mr *MockAPIMockRecorder) Disconnect() *gomock.Call
- func (mr *MockAPIMockRecorder) DisconnectNotify() *gomock.Call
- func (mr *MockAPIMockRecorder) Echo(arg0 any) *gomock.Call
- func (mr *MockAPIMockRecorder) Get(arg0, arg1 any) *gomock.Call
- func (mr *MockAPIMockRecorder) GetBridgeNameByInterface(ctx, name any) *gomock.Call
- func (mr *MockAPIMockRecorder) GetBridgeNameByPort(ctx, name any) *gomock.Call
- func (mr *MockAPIMockRecorder) GetBridgeWithName(ctx, name any) *gomock.Call
- func (mr *MockAPIMockRecorder) GetIfaceWithExternalIDs(ctx, externalIDs any) *gomock.Call
- func (mr *MockAPIMockRecorder) GetIfaceWithName(ctx, name any) *gomock.Call
- func (mr *MockAPIMockRecorder) GetInterfaceLinkState(ctx, name any) *gomock.Call
- func (mr *MockAPIMockRecorder) GetOpenVSwitchExternalIDs(ctx any) *gomock.Call
- func (mr *MockAPIMockRecorder) GetPortVLANState(ctx, name any) *gomock.Call
- func (mr *MockAPIMockRecorder) IsIfaceInBr(ctx, bridgeName, portName any) *gomock.Call
- func (mr *MockAPIMockRecorder) List(ctx, result any) *gomock.Call
- func (mr *MockAPIMockRecorder) ListBridgesWithExternalIDs(ctx, externalIDs any) *gomock.Call
- func (mr *MockAPIMockRecorder) ListInterfacesWithError(ctx any) *gomock.Call
- func (mr *MockAPIMockRecorder) Monitor(arg0, arg1 any) *gomock.Call
- func (mr *MockAPIMockRecorder) MonitorAll(arg0 any) *gomock.Call
- func (mr *MockAPIMockRecorder) MonitorCancel(ctx, cookie any) *gomock.Call
- func (mr *MockAPIMockRecorder) NewMonitor(arg0 ...any) *gomock.Call
- func (mr *MockAPIMockRecorder) Schema() *gomock.Call
- func (mr *MockAPIMockRecorder) SetBridgeExternalIDs(ctx, name, externalIDs any) *gomock.Call
- func (mr *MockAPIMockRecorder) SetIfaceExternalIDs(ctx, name, externalIDs any) *gomock.Call
- func (mr *MockAPIMockRecorder) SetIfaceOptions(ctx, name, options any) *gomock.Call
- func (mr *MockAPIMockRecorder) SetOpenVSwitchExternalIDs(ctx, externalIDs any) *gomock.Call
- func (mr *MockAPIMockRecorder) SetOption(arg0 any) *gomock.Call
- func (mr *MockAPIMockRecorder) SetPortExternalIDs(ctx, name, externalIDs any) *gomock.Call
- func (mr *MockAPIMockRecorder) Transact(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockAPIMockRecorder) UpdateEndpoints(arg0 any) *gomock.Call
- func (mr *MockAPIMockRecorder) ValidateBridgeExists(ctx, bridgeName any) *gomock.Call
- func (mr *MockAPIMockRecorder) Where(arg0 ...any) *gomock.Call
- func (mr *MockAPIMockRecorder) WhereAll(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockAPIMockRecorder) WhereAny(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockAPIMockRecorder) WhereCache(predicate any) *gomock.Call
- type MockClient
- func (m *MockClient) Cache() *cache.TableCache
- func (m *MockClient) Close()
- func (m *MockClient) Connect(arg0 context.Context) error
- func (m *MockClient) Connected() bool
- func (m *MockClient) Create(arg0 ...model.Model) ([]ovsdb.Operation, error)
- func (m *MockClient) CurrentEndpoint() string
- func (m *MockClient) Disconnect()
- func (m *MockClient) DisconnectNotify() chan struct{}
- func (m *MockClient) EXPECT() *MockClientMockRecorder
- func (m *MockClient) Echo(arg0 context.Context) error
- func (m *MockClient) Get(arg0 context.Context, arg1 model.Model) error
- func (m *MockClient) List(ctx context.Context, result any) error
- func (m *MockClient) Monitor(arg0 context.Context, arg1 *client.Monitor) (client.MonitorCookie, error)
- func (m *MockClient) MonitorAll(arg0 context.Context) (client.MonitorCookie, error)
- func (m *MockClient) MonitorCancel(ctx context.Context, cookie client.MonitorCookie) error
- func (m *MockClient) NewMonitor(arg0 ...client.MonitorOption) *client.Monitor
- func (m *MockClient) Schema() ovsdb.DatabaseSchema
- func (m *MockClient) SetOption(arg0 client.Option) error
- func (m *MockClient) Transact(arg0 context.Context, arg1 ...ovsdb.Operation) ([]ovsdb.OperationResult, error)
- func (m *MockClient) UpdateEndpoints(arg0 []string)
- func (m *MockClient) Where(arg0 ...model.Model) client.ConditionalAPI
- func (m *MockClient) WhereAll(arg0 model.Model, arg1 ...model.Condition) client.ConditionalAPI
- func (m *MockClient) WhereAny(arg0 model.Model, arg1 ...model.Condition) client.ConditionalAPI
- func (m *MockClient) WhereCache(predicate any) client.ConditionalAPI
- type MockClientMockRecorder
- func (mr *MockClientMockRecorder) Cache() *gomock.Call
- func (mr *MockClientMockRecorder) Close() *gomock.Call
- func (mr *MockClientMockRecorder) Connect(arg0 any) *gomock.Call
- func (mr *MockClientMockRecorder) Connected() *gomock.Call
- func (mr *MockClientMockRecorder) Create(arg0 ...any) *gomock.Call
- func (mr *MockClientMockRecorder) CurrentEndpoint() *gomock.Call
- func (mr *MockClientMockRecorder) Disconnect() *gomock.Call
- func (mr *MockClientMockRecorder) DisconnectNotify() *gomock.Call
- func (mr *MockClientMockRecorder) Echo(arg0 any) *gomock.Call
- func (mr *MockClientMockRecorder) Get(arg0, arg1 any) *gomock.Call
- func (mr *MockClientMockRecorder) List(ctx, result any) *gomock.Call
- func (mr *MockClientMockRecorder) Monitor(arg0, arg1 any) *gomock.Call
- func (mr *MockClientMockRecorder) MonitorAll(arg0 any) *gomock.Call
- func (mr *MockClientMockRecorder) MonitorCancel(ctx, cookie any) *gomock.Call
- func (mr *MockClientMockRecorder) NewMonitor(arg0 ...any) *gomock.Call
- func (mr *MockClientMockRecorder) Schema() *gomock.Call
- func (mr *MockClientMockRecorder) SetOption(arg0 any) *gomock.Call
- func (mr *MockClientMockRecorder) Transact(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockClientMockRecorder) UpdateEndpoints(arg0 any) *gomock.Call
- func (mr *MockClientMockRecorder) Where(arg0 ...any) *gomock.Call
- func (mr *MockClientMockRecorder) WhereAll(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockClientMockRecorder) WhereAny(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockClientMockRecorder) WhereCache(predicate any) *gomock.Call
- type MockConditionalAPI
- func (m *MockConditionalAPI) Delete() ([]ovsdb.Operation, error)
- func (m *MockConditionalAPI) EXPECT() *MockConditionalAPIMockRecorder
- func (m *MockConditionalAPI) List(ctx context.Context, result any) error
- func (m *MockConditionalAPI) Mutate(arg0 model.Model, arg1 ...model.Mutation) ([]ovsdb.Operation, error)
- func (m *MockConditionalAPI) Update(arg0 model.Model, arg1 ...any) ([]ovsdb.Operation, error)
- func (m *MockConditionalAPI) Wait(arg0 ovsdb.WaitCondition, arg1 *int, arg2 model.Model, arg3 ...any) ([]ovsdb.Operation, error)
- type MockConditionalAPIMockRecorder
- func (mr *MockConditionalAPIMockRecorder) Delete() *gomock.Call
- func (mr *MockConditionalAPIMockRecorder) List(ctx, result any) *gomock.Call
- func (mr *MockConditionalAPIMockRecorder) Mutate(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockConditionalAPIMockRecorder) Update(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockConditionalAPIMockRecorder) Wait(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call
- type PortConfig
- type PortVLANState
Constants ¶
const ( InterfaceTypeInternal = "internal" DPFIDKey = "dpf-id" // OVS external_ids key for DPF identifier DPFTypeKey = "dpf-type" // OVS external_ids key for DPF type DPFTypePhysical = "physical" // Physical port type value )
Variables ¶
var ErrIfaceNotFound = errors.New("failed to find matching interface")
ErrIfaceNotFound is returned by GetIfaceWithExternalIDs when no Interface matches.
var ( // ErrNotFound is returned when a resource is not found. ErrNotFound = ovsclient.ErrNotFound )
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
ovsclient.Client
// Open vSwitch Commands
SetOpenVSwitchExternalIDs(ctx context.Context, externalIDs map[string]string) error
GetOpenVSwitchExternalIDs(ctx context.Context) (map[string]string, error)
// Bridge Commands
ValidateBridgeExists(ctx context.Context, bridgeName string) error
GetBridgeNameByInterface(ctx context.Context, name string) (string, error)
GetBridgeNameByPort(ctx context.Context, name string) (string, error)
AddBridge(ctx context.Context, bridgeConfig BridgeConfig) error
SetBridgeExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
ListBridgesWithExternalIDs(ctx context.Context, externalIDs map[string]string) ([]ovsmodel.Bridge, error)
GetBridgeWithName(ctx context.Context, name string) (*ovsmodel.Bridge, error)
DeleteBridge(ctx context.Context, name string) error
// Port Commands
AddPort(ctx context.Context, portConfig PortConfig) error
DelPort(ctx context.Context, bridgeName, portName string, opt *DelPortOpt) error
GetPortVLANState(ctx context.Context, name string) (PortVLANState, error)
SetPortExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
// Interface Commands
GetInterfaceLinkState(ctx context.Context, name string) (ovsmodel.InterfaceLinkState, error)
ListInterfacesWithError(ctx context.Context) ([]string, error)
SetIfaceExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
GetIfaceWithExternalIDs(ctx context.Context, externalIDs map[string]string) (*ovsmodel.Interface, error)
SetIfaceOptions(ctx context.Context, name string, options map[string]string) error
IsIfaceInBr(ctx context.Context, bridgeName, portName string) (bool, error)
GetIfaceWithName(ctx context.Context, name string) (*ovsmodel.Interface, error)
}
type BridgeConfig ¶
type BridgeConfig struct {
// Name is the OVS bridge name.
Name string
// DatapathType is the OVS datapath type (e.g. "system", "netdev").
DatapathType string
// SkipCreateInternalPort, when true, skips creating the default internal port and interface.
// By default (false), an internal port is created using InternalInterfaceName if set, otherwise the bridge name.
SkipCreateInternalPort bool
// InternalInterfaceName overrides the name of the internal port/interface (must be <= 15 characters, Linux IFNAMSIZ).
// When nil, the bridge name is used. Only relevant when SkipCreateInternalPort is false.
InternalInterfaceName *string
// FailMode controls the bridge's behavior when no OpenFlow controller is connected.
// "secure" drops all traffic, "standalone" falls back to normal L2 learning. Nil leaves it unset.
FailMode *string
// ExternalIDs are the external IDs to set for the bridge.
ExternalIDs map[string]string
// OtherConfig are the other_config values to set for the bridge.
OtherConfig map[string]string
}
BridgeConfig holds the configuration for creating an OVS bridge.
type Client ¶
func (*Client) AddBridge ¶
func (c *Client) AddBridge(ctx context.Context, bridgeConfig BridgeConfig) error
func (*Client) AddPort ¶
func (c *Client) AddPort(ctx context.Context, portConfig PortConfig) error
AddPort creates an interface, port, and attaches it to a bridge in a single transaction. No-op if the port already exists on the same bridge, errors if it exists on a different one. Optional PortConfig fields are written in the same transaction.
func (*Client) DelPort ¶
DelPort deletes a port from a bridge. When opt.Owner is set, ports with a different owner are rejected.
func (*Client) DeleteBridge ¶
DeleteBridge deletes a bridge from OVSDB. OVSDB automatically garbage collects orphaned ports and interfaces when a bridge is deleted. The bridge reference should first be removed from Open_vSwitch.Bridges. This matches the behavior of `ovs-vsctl del-br`.
func (*Client) GetBridgeNameByInterface ¶
GetBridgeNameByInterface returns the bridge name that contains an interface.
func (*Client) GetBridgeNameByPort ¶
GetBridgeNameByPort returns the bridge name that contains a port.
func (*Client) GetBridgeWithName ¶
GetBridgeWithName gets a bridge by name. Returns ErrNotFound if the bridge is not found.
func (*Client) GetIfaceWithExternalIDs ¶
func (*Client) GetIfaceWithName ¶
func (*Client) GetInterfaceLinkState ¶
func (c *Client) GetInterfaceLinkState(ctx context.Context, name string) (ovsmodel.InterfaceLinkState, error)
GetInterfaceLinkState returns the OVS link_state for an interface.
func (*Client) GetOpenVSwitch ¶
func (*Client) GetOpenVSwitchExternalIDs ¶
func (*Client) GetPortVLANState ¶
GetPortVLANState returns the VLAN configuration for an OVS port.
func (*Client) IsIfaceInBr ¶
func (*Client) ListBridgesWithExternalIDs ¶
func (c *Client) ListBridgesWithExternalIDs(ctx context.Context, externalIDs map[string]string) ([]ovsmodel.Bridge, error)
ListBridgesWithExternalIDs returns all bridges whose external_ids contain the given key-value pairs. For example, externalIDs map[string]string{"weave-owner-ref": "global"} returns all bridges with that external_id. Returns an error if externalIDs is empty (to avoid accidentally listing all bridges).
func (*Client) ListInterfacesWithError ¶
ListInterfacesWithError returns interface names with a non-empty OVS error.
func (*Client) SetBridgeExternalIDs ¶
func (c *Client) SetBridgeExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
SetBridgeExternalIDs sets the external IDs for a bridge. It is a no-op if externalIDs is empty or if the bridge already has the requested keys with the same values.
func (*Client) SetBridgeOtherConfig ¶
func (c *Client) SetBridgeOtherConfig(ctx context.Context, name string, otherConfig map[string]string) error
SetBridgeOtherConfig sets the other_config for a bridge. It is a no-op if otherConfig is empty or if the bridge already has the requested keys with the same values.
func (*Client) SetIfaceExternalIDs ¶
func (c *Client) SetIfaceExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
SetIfaceExternalIDs sets the external IDs for an interface. It is a no-op if externalIDs is empty or if the interface already has the requested keys with the same values.
func (*Client) SetIfaceOptions ¶
SetIfaceOptions sets keys on the interface options map (existing keys get new values). No-op if options is empty or values already match.
func (*Client) SetOpenVSwitchExternalIDs ¶
func (*Client) SetPortExternalIDs ¶
func (c *Client) SetPortExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
SetPortExternalIDs sets the external IDs for a port. It is a no-op if externalIDs is empty or if the port already has the requested keys with the same values.
type DelPortOpt ¶
type DelPortOpt struct {
Owner string
}
DelPortOpt configures optional DelPort guards.
type MockAPI ¶
type MockAPI struct {
// contains filtered or unexported fields
}
MockAPI is a mock of API interface.
func NewMockAPI ¶
func NewMockAPI(ctrl *gomock.Controller) *MockAPI
NewMockAPI creates a new mock instance.
func (*MockAPI) AddBridge ¶
func (m *MockAPI) AddBridge(ctx context.Context, bridgeConfig BridgeConfig) error
AddBridge mocks base method.
func (*MockAPI) AddPort ¶
func (m *MockAPI) AddPort(ctx context.Context, portConfig PortConfig) error
AddPort mocks base method.
func (*MockAPI) CurrentEndpoint ¶
CurrentEndpoint mocks base method.
func (*MockAPI) DeleteBridge ¶
DeleteBridge mocks base method.
func (*MockAPI) DisconnectNotify ¶
func (m *MockAPI) DisconnectNotify() chan struct{}
DisconnectNotify mocks base method.
func (*MockAPI) EXPECT ¶
func (m *MockAPI) EXPECT() *MockAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockAPI) GetBridgeNameByInterface ¶
GetBridgeNameByInterface mocks base method.
func (*MockAPI) GetBridgeNameByPort ¶
GetBridgeNameByPort mocks base method.
func (*MockAPI) GetBridgeWithName ¶
GetBridgeWithName mocks base method.
func (*MockAPI) GetIfaceWithExternalIDs ¶
func (m *MockAPI) GetIfaceWithExternalIDs(ctx context.Context, externalIDs map[string]string) (*ovsmodel.Interface, error)
GetIfaceWithExternalIDs mocks base method.
func (*MockAPI) GetIfaceWithName ¶
GetIfaceWithName mocks base method.
func (*MockAPI) GetInterfaceLinkState ¶
func (m *MockAPI) GetInterfaceLinkState(ctx context.Context, name string) (ovsmodel.InterfaceLinkState, error)
GetInterfaceLinkState mocks base method.
func (*MockAPI) GetOpenVSwitchExternalIDs ¶
GetOpenVSwitchExternalIDs mocks base method.
func (*MockAPI) GetPortVLANState ¶
GetPortVLANState mocks base method.
func (*MockAPI) IsIfaceInBr ¶
IsIfaceInBr mocks base method.
func (*MockAPI) ListBridgesWithExternalIDs ¶
func (m *MockAPI) ListBridgesWithExternalIDs(ctx context.Context, externalIDs map[string]string) ([]ovsmodel.Bridge, error)
ListBridgesWithExternalIDs mocks base method.
func (*MockAPI) ListInterfacesWithError ¶
ListInterfacesWithError mocks base method.
func (*MockAPI) MonitorAll ¶
MonitorAll mocks base method.
func (*MockAPI) MonitorCancel ¶
MonitorCancel mocks base method.
func (*MockAPI) NewMonitor ¶
func (m *MockAPI) NewMonitor(arg0 ...client.MonitorOption) *client.Monitor
NewMonitor mocks base method.
func (*MockAPI) SetBridgeExternalIDs ¶
func (m *MockAPI) SetBridgeExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
SetBridgeExternalIDs mocks base method.
func (*MockAPI) SetIfaceExternalIDs ¶
func (m *MockAPI) SetIfaceExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
SetIfaceExternalIDs mocks base method.
func (*MockAPI) SetIfaceOptions ¶
func (m *MockAPI) SetIfaceOptions(ctx context.Context, name string, options map[string]string) error
SetIfaceOptions mocks base method.
func (*MockAPI) SetOpenVSwitchExternalIDs ¶
func (m *MockAPI) SetOpenVSwitchExternalIDs(ctx context.Context, externalIDs map[string]string) error
SetOpenVSwitchExternalIDs mocks base method.
func (*MockAPI) SetPortExternalIDs ¶
func (m *MockAPI) SetPortExternalIDs(ctx context.Context, name string, externalIDs map[string]string) error
SetPortExternalIDs mocks base method.
func (*MockAPI) Transact ¶
func (m *MockAPI) Transact(arg0 context.Context, arg1 ...ovsdb.Operation) ([]ovsdb.OperationResult, error)
Transact mocks base method.
func (*MockAPI) UpdateEndpoints ¶
UpdateEndpoints mocks base method.
func (*MockAPI) ValidateBridgeExists ¶
ValidateBridgeExists mocks base method.
func (*MockAPI) Where ¶
func (m *MockAPI) Where(arg0 ...model.Model) client.ConditionalAPI
Where mocks base method.
func (*MockAPI) WhereCache ¶
func (m *MockAPI) WhereCache(predicate any) client.ConditionalAPI
WhereCache mocks base method.
type MockAPIMockRecorder ¶
type MockAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockAPIMockRecorder is the mock recorder for MockAPI.
func (*MockAPIMockRecorder) AddBridge ¶
func (mr *MockAPIMockRecorder) AddBridge(ctx, bridgeConfig any) *gomock.Call
AddBridge indicates an expected call of AddBridge.
func (*MockAPIMockRecorder) AddPort ¶
func (mr *MockAPIMockRecorder) AddPort(ctx, portConfig any) *gomock.Call
AddPort indicates an expected call of AddPort.
func (*MockAPIMockRecorder) Cache ¶
func (mr *MockAPIMockRecorder) Cache() *gomock.Call
Cache indicates an expected call of Cache.
func (*MockAPIMockRecorder) Close ¶
func (mr *MockAPIMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockAPIMockRecorder) Connect ¶
func (mr *MockAPIMockRecorder) Connect(arg0 any) *gomock.Call
Connect indicates an expected call of Connect.
func (*MockAPIMockRecorder) Connected ¶
func (mr *MockAPIMockRecorder) Connected() *gomock.Call
Connected indicates an expected call of Connected.
func (*MockAPIMockRecorder) Create ¶
func (mr *MockAPIMockRecorder) Create(arg0 ...any) *gomock.Call
Create indicates an expected call of Create.
func (*MockAPIMockRecorder) CurrentEndpoint ¶
func (mr *MockAPIMockRecorder) CurrentEndpoint() *gomock.Call
CurrentEndpoint indicates an expected call of CurrentEndpoint.
func (*MockAPIMockRecorder) DelPort ¶
func (mr *MockAPIMockRecorder) DelPort(ctx, bridgeName, portName, opt any) *gomock.Call
DelPort indicates an expected call of DelPort.
func (*MockAPIMockRecorder) DeleteBridge ¶
func (mr *MockAPIMockRecorder) DeleteBridge(ctx, name any) *gomock.Call
DeleteBridge indicates an expected call of DeleteBridge.
func (*MockAPIMockRecorder) Disconnect ¶
func (mr *MockAPIMockRecorder) Disconnect() *gomock.Call
Disconnect indicates an expected call of Disconnect.
func (*MockAPIMockRecorder) DisconnectNotify ¶
func (mr *MockAPIMockRecorder) DisconnectNotify() *gomock.Call
DisconnectNotify indicates an expected call of DisconnectNotify.
func (*MockAPIMockRecorder) Echo ¶
func (mr *MockAPIMockRecorder) Echo(arg0 any) *gomock.Call
Echo indicates an expected call of Echo.
func (*MockAPIMockRecorder) Get ¶
func (mr *MockAPIMockRecorder) Get(arg0, arg1 any) *gomock.Call
Get indicates an expected call of Get.
func (*MockAPIMockRecorder) GetBridgeNameByInterface ¶
func (mr *MockAPIMockRecorder) GetBridgeNameByInterface(ctx, name any) *gomock.Call
GetBridgeNameByInterface indicates an expected call of GetBridgeNameByInterface.
func (*MockAPIMockRecorder) GetBridgeNameByPort ¶
func (mr *MockAPIMockRecorder) GetBridgeNameByPort(ctx, name any) *gomock.Call
GetBridgeNameByPort indicates an expected call of GetBridgeNameByPort.
func (*MockAPIMockRecorder) GetBridgeWithName ¶
func (mr *MockAPIMockRecorder) GetBridgeWithName(ctx, name any) *gomock.Call
GetBridgeWithName indicates an expected call of GetBridgeWithName.
func (*MockAPIMockRecorder) GetIfaceWithExternalIDs ¶
func (mr *MockAPIMockRecorder) GetIfaceWithExternalIDs(ctx, externalIDs any) *gomock.Call
GetIfaceWithExternalIDs indicates an expected call of GetIfaceWithExternalIDs.
func (*MockAPIMockRecorder) GetIfaceWithName ¶
func (mr *MockAPIMockRecorder) GetIfaceWithName(ctx, name any) *gomock.Call
GetIfaceWithName indicates an expected call of GetIfaceWithName.
func (*MockAPIMockRecorder) GetInterfaceLinkState ¶
func (mr *MockAPIMockRecorder) GetInterfaceLinkState(ctx, name any) *gomock.Call
GetInterfaceLinkState indicates an expected call of GetInterfaceLinkState.
func (*MockAPIMockRecorder) GetOpenVSwitchExternalIDs ¶
func (mr *MockAPIMockRecorder) GetOpenVSwitchExternalIDs(ctx any) *gomock.Call
GetOpenVSwitchExternalIDs indicates an expected call of GetOpenVSwitchExternalIDs.
func (*MockAPIMockRecorder) GetPortVLANState ¶
func (mr *MockAPIMockRecorder) GetPortVLANState(ctx, name any) *gomock.Call
GetPortVLANState indicates an expected call of GetPortVLANState.
func (*MockAPIMockRecorder) IsIfaceInBr ¶
func (mr *MockAPIMockRecorder) IsIfaceInBr(ctx, bridgeName, portName any) *gomock.Call
IsIfaceInBr indicates an expected call of IsIfaceInBr.
func (*MockAPIMockRecorder) List ¶
func (mr *MockAPIMockRecorder) List(ctx, result any) *gomock.Call
List indicates an expected call of List.
func (*MockAPIMockRecorder) ListBridgesWithExternalIDs ¶
func (mr *MockAPIMockRecorder) ListBridgesWithExternalIDs(ctx, externalIDs any) *gomock.Call
ListBridgesWithExternalIDs indicates an expected call of ListBridgesWithExternalIDs.
func (*MockAPIMockRecorder) ListInterfacesWithError ¶
func (mr *MockAPIMockRecorder) ListInterfacesWithError(ctx any) *gomock.Call
ListInterfacesWithError indicates an expected call of ListInterfacesWithError.
func (*MockAPIMockRecorder) Monitor ¶
func (mr *MockAPIMockRecorder) Monitor(arg0, arg1 any) *gomock.Call
Monitor indicates an expected call of Monitor.
func (*MockAPIMockRecorder) MonitorAll ¶
func (mr *MockAPIMockRecorder) MonitorAll(arg0 any) *gomock.Call
MonitorAll indicates an expected call of MonitorAll.
func (*MockAPIMockRecorder) MonitorCancel ¶
func (mr *MockAPIMockRecorder) MonitorCancel(ctx, cookie any) *gomock.Call
MonitorCancel indicates an expected call of MonitorCancel.
func (*MockAPIMockRecorder) NewMonitor ¶
func (mr *MockAPIMockRecorder) NewMonitor(arg0 ...any) *gomock.Call
NewMonitor indicates an expected call of NewMonitor.
func (*MockAPIMockRecorder) Schema ¶
func (mr *MockAPIMockRecorder) Schema() *gomock.Call
Schema indicates an expected call of Schema.
func (*MockAPIMockRecorder) SetBridgeExternalIDs ¶
func (mr *MockAPIMockRecorder) SetBridgeExternalIDs(ctx, name, externalIDs any) *gomock.Call
SetBridgeExternalIDs indicates an expected call of SetBridgeExternalIDs.
func (*MockAPIMockRecorder) SetIfaceExternalIDs ¶
func (mr *MockAPIMockRecorder) SetIfaceExternalIDs(ctx, name, externalIDs any) *gomock.Call
SetIfaceExternalIDs indicates an expected call of SetIfaceExternalIDs.
func (*MockAPIMockRecorder) SetIfaceOptions ¶
func (mr *MockAPIMockRecorder) SetIfaceOptions(ctx, name, options any) *gomock.Call
SetIfaceOptions indicates an expected call of SetIfaceOptions.
func (*MockAPIMockRecorder) SetOpenVSwitchExternalIDs ¶
func (mr *MockAPIMockRecorder) SetOpenVSwitchExternalIDs(ctx, externalIDs any) *gomock.Call
SetOpenVSwitchExternalIDs indicates an expected call of SetOpenVSwitchExternalIDs.
func (*MockAPIMockRecorder) SetOption ¶
func (mr *MockAPIMockRecorder) SetOption(arg0 any) *gomock.Call
SetOption indicates an expected call of SetOption.
func (*MockAPIMockRecorder) SetPortExternalIDs ¶
func (mr *MockAPIMockRecorder) SetPortExternalIDs(ctx, name, externalIDs any) *gomock.Call
SetPortExternalIDs indicates an expected call of SetPortExternalIDs.
func (*MockAPIMockRecorder) Transact ¶
func (mr *MockAPIMockRecorder) Transact(arg0 any, arg1 ...any) *gomock.Call
Transact indicates an expected call of Transact.
func (*MockAPIMockRecorder) UpdateEndpoints ¶
func (mr *MockAPIMockRecorder) UpdateEndpoints(arg0 any) *gomock.Call
UpdateEndpoints indicates an expected call of UpdateEndpoints.
func (*MockAPIMockRecorder) ValidateBridgeExists ¶
func (mr *MockAPIMockRecorder) ValidateBridgeExists(ctx, bridgeName any) *gomock.Call
ValidateBridgeExists indicates an expected call of ValidateBridgeExists.
func (*MockAPIMockRecorder) Where ¶
func (mr *MockAPIMockRecorder) Where(arg0 ...any) *gomock.Call
Where indicates an expected call of Where.
func (*MockAPIMockRecorder) WhereAll ¶
func (mr *MockAPIMockRecorder) WhereAll(arg0 any, arg1 ...any) *gomock.Call
WhereAll indicates an expected call of WhereAll.
func (*MockAPIMockRecorder) WhereAny ¶
func (mr *MockAPIMockRecorder) WhereAny(arg0 any, arg1 ...any) *gomock.Call
WhereAny indicates an expected call of WhereAny.
func (*MockAPIMockRecorder) WhereCache ¶
func (mr *MockAPIMockRecorder) WhereCache(predicate any) *gomock.Call
WhereCache indicates an expected call of WhereCache.
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface.
func NewMockClient ¶
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (*MockClient) Connect ¶
func (m *MockClient) Connect(arg0 context.Context) error
Connect mocks base method.
func (*MockClient) CurrentEndpoint ¶
func (m *MockClient) CurrentEndpoint() string
CurrentEndpoint mocks base method.
func (*MockClient) DisconnectNotify ¶
func (m *MockClient) DisconnectNotify() chan struct{}
DisconnectNotify mocks base method.
func (*MockClient) EXPECT ¶
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockClient) Echo ¶
func (m *MockClient) Echo(arg0 context.Context) error
Echo mocks base method.
func (*MockClient) List ¶
func (m *MockClient) List(ctx context.Context, result any) error
List mocks base method.
func (*MockClient) Monitor ¶
func (m *MockClient) Monitor(arg0 context.Context, arg1 *client.Monitor) (client.MonitorCookie, error)
Monitor mocks base method.
func (*MockClient) MonitorAll ¶
func (m *MockClient) MonitorAll(arg0 context.Context) (client.MonitorCookie, error)
MonitorAll mocks base method.
func (*MockClient) MonitorCancel ¶
func (m *MockClient) MonitorCancel(ctx context.Context, cookie client.MonitorCookie) error
MonitorCancel mocks base method.
func (*MockClient) NewMonitor ¶
func (m *MockClient) NewMonitor(arg0 ...client.MonitorOption) *client.Monitor
NewMonitor mocks base method.
func (*MockClient) Schema ¶
func (m *MockClient) Schema() ovsdb.DatabaseSchema
Schema mocks base method.
func (*MockClient) SetOption ¶
func (m *MockClient) SetOption(arg0 client.Option) error
SetOption mocks base method.
func (*MockClient) Transact ¶
func (m *MockClient) Transact(arg0 context.Context, arg1 ...ovsdb.Operation) ([]ovsdb.OperationResult, error)
Transact mocks base method.
func (*MockClient) UpdateEndpoints ¶
func (m *MockClient) UpdateEndpoints(arg0 []string)
UpdateEndpoints mocks base method.
func (*MockClient) Where ¶
func (m *MockClient) Where(arg0 ...model.Model) client.ConditionalAPI
Where mocks base method.
func (*MockClient) WhereAll ¶
func (m *MockClient) WhereAll(arg0 model.Model, arg1 ...model.Condition) client.ConditionalAPI
WhereAll mocks base method.
func (*MockClient) WhereAny ¶
func (m *MockClient) WhereAny(arg0 model.Model, arg1 ...model.Condition) client.ConditionalAPI
WhereAny mocks base method.
func (*MockClient) WhereCache ¶
func (m *MockClient) WhereCache(predicate any) client.ConditionalAPI
WhereCache mocks base method.
type MockClientMockRecorder ¶
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient.
func (*MockClientMockRecorder) Cache ¶
func (mr *MockClientMockRecorder) Cache() *gomock.Call
Cache indicates an expected call of Cache.
func (*MockClientMockRecorder) Close ¶
func (mr *MockClientMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockClientMockRecorder) Connect ¶
func (mr *MockClientMockRecorder) Connect(arg0 any) *gomock.Call
Connect indicates an expected call of Connect.
func (*MockClientMockRecorder) Connected ¶
func (mr *MockClientMockRecorder) Connected() *gomock.Call
Connected indicates an expected call of Connected.
func (*MockClientMockRecorder) Create ¶
func (mr *MockClientMockRecorder) Create(arg0 ...any) *gomock.Call
Create indicates an expected call of Create.
func (*MockClientMockRecorder) CurrentEndpoint ¶
func (mr *MockClientMockRecorder) CurrentEndpoint() *gomock.Call
CurrentEndpoint indicates an expected call of CurrentEndpoint.
func (*MockClientMockRecorder) Disconnect ¶
func (mr *MockClientMockRecorder) Disconnect() *gomock.Call
Disconnect indicates an expected call of Disconnect.
func (*MockClientMockRecorder) DisconnectNotify ¶
func (mr *MockClientMockRecorder) DisconnectNotify() *gomock.Call
DisconnectNotify indicates an expected call of DisconnectNotify.
func (*MockClientMockRecorder) Echo ¶
func (mr *MockClientMockRecorder) Echo(arg0 any) *gomock.Call
Echo indicates an expected call of Echo.
func (*MockClientMockRecorder) Get ¶
func (mr *MockClientMockRecorder) Get(arg0, arg1 any) *gomock.Call
Get indicates an expected call of Get.
func (*MockClientMockRecorder) List ¶
func (mr *MockClientMockRecorder) List(ctx, result any) *gomock.Call
List indicates an expected call of List.
func (*MockClientMockRecorder) Monitor ¶
func (mr *MockClientMockRecorder) Monitor(arg0, arg1 any) *gomock.Call
Monitor indicates an expected call of Monitor.
func (*MockClientMockRecorder) MonitorAll ¶
func (mr *MockClientMockRecorder) MonitorAll(arg0 any) *gomock.Call
MonitorAll indicates an expected call of MonitorAll.
func (*MockClientMockRecorder) MonitorCancel ¶
func (mr *MockClientMockRecorder) MonitorCancel(ctx, cookie any) *gomock.Call
MonitorCancel indicates an expected call of MonitorCancel.
func (*MockClientMockRecorder) NewMonitor ¶
func (mr *MockClientMockRecorder) NewMonitor(arg0 ...any) *gomock.Call
NewMonitor indicates an expected call of NewMonitor.
func (*MockClientMockRecorder) Schema ¶
func (mr *MockClientMockRecorder) Schema() *gomock.Call
Schema indicates an expected call of Schema.
func (*MockClientMockRecorder) SetOption ¶
func (mr *MockClientMockRecorder) SetOption(arg0 any) *gomock.Call
SetOption indicates an expected call of SetOption.
func (*MockClientMockRecorder) Transact ¶
func (mr *MockClientMockRecorder) Transact(arg0 any, arg1 ...any) *gomock.Call
Transact indicates an expected call of Transact.
func (*MockClientMockRecorder) UpdateEndpoints ¶
func (mr *MockClientMockRecorder) UpdateEndpoints(arg0 any) *gomock.Call
UpdateEndpoints indicates an expected call of UpdateEndpoints.
func (*MockClientMockRecorder) Where ¶
func (mr *MockClientMockRecorder) Where(arg0 ...any) *gomock.Call
Where indicates an expected call of Where.
func (*MockClientMockRecorder) WhereAll ¶
func (mr *MockClientMockRecorder) WhereAll(arg0 any, arg1 ...any) *gomock.Call
WhereAll indicates an expected call of WhereAll.
func (*MockClientMockRecorder) WhereAny ¶
func (mr *MockClientMockRecorder) WhereAny(arg0 any, arg1 ...any) *gomock.Call
WhereAny indicates an expected call of WhereAny.
func (*MockClientMockRecorder) WhereCache ¶
func (mr *MockClientMockRecorder) WhereCache(predicate any) *gomock.Call
WhereCache indicates an expected call of WhereCache.
type MockConditionalAPI ¶
type MockConditionalAPI struct {
// contains filtered or unexported fields
}
MockConditionalAPI is a mock of ConditionalAPI interface.
func NewMockConditionalAPI ¶
func NewMockConditionalAPI(ctrl *gomock.Controller) *MockConditionalAPI
NewMockConditionalAPI creates a new mock instance.
func (*MockConditionalAPI) Delete ¶
func (m *MockConditionalAPI) Delete() ([]ovsdb.Operation, error)
Delete mocks base method.
func (*MockConditionalAPI) EXPECT ¶
func (m *MockConditionalAPI) EXPECT() *MockConditionalAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockConditionalAPI) List ¶
func (m *MockConditionalAPI) List(ctx context.Context, result any) error
List mocks base method.
func (*MockConditionalAPI) Mutate ¶
func (m *MockConditionalAPI) Mutate(arg0 model.Model, arg1 ...model.Mutation) ([]ovsdb.Operation, error)
Mutate mocks base method.
type MockConditionalAPIMockRecorder ¶
type MockConditionalAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockConditionalAPIMockRecorder is the mock recorder for MockConditionalAPI.
func (*MockConditionalAPIMockRecorder) Delete ¶
func (mr *MockConditionalAPIMockRecorder) Delete() *gomock.Call
Delete indicates an expected call of Delete.
func (*MockConditionalAPIMockRecorder) List ¶
func (mr *MockConditionalAPIMockRecorder) List(ctx, result any) *gomock.Call
List indicates an expected call of List.
func (*MockConditionalAPIMockRecorder) Mutate ¶
func (mr *MockConditionalAPIMockRecorder) Mutate(arg0 any, arg1 ...any) *gomock.Call
Mutate indicates an expected call of Mutate.
type PortConfig ¶
type PortConfig struct {
Name string
BridgeName string
InterfaceType string
MTU *int
InterfaceOptions map[string]string
// Optional fields below are written in the same transaction as port creation.
InterfaceExternalIDs map[string]string
PortExternalIDs map[string]string
OFPortRequest *int
VLANMode *ovsmodel.PortVLANMode
Tag *int
Trunks []int
// WaitForOFPortFree, when set with OFPortRequest, aborts the transaction
// if another Interface already requested the same ofport.
WaitForOFPortFree bool
}
type PortVLANState ¶
type PortVLANState struct {
Mode *ovsmodel.PortVLANMode
Tag *int
Trunks []int
}
PortVLANState holds the VLAN configuration read from an OVS port.