ovsutils

package
v0.1.0-latest-stable Latest Latest
Warning

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

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

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

View Source
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

View Source
var ErrIfaceNotFound = errors.New("failed to find matching interface")

ErrIfaceNotFound is returned by GetIfaceWithExternalIDs when no Interface matches.

View Source
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

type Client struct {
	ovsclient.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

func (c *Client) DelPort(ctx context.Context, bridgeName, portName string, opt *DelPortOpt) error

DelPort deletes a port from a bridge. When opt.Owner is set, ports with a different owner are rejected.

func (*Client) DeleteBridge

func (c *Client) DeleteBridge(ctx context.Context, name string) error

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

func (c *Client) GetBridgeNameByInterface(ctx context.Context, name string) (string, error)

GetBridgeNameByInterface returns the bridge name that contains an interface.

func (*Client) GetBridgeNameByPort

func (c *Client) GetBridgeNameByPort(ctx context.Context, name string) (string, error)

GetBridgeNameByPort returns the bridge name that contains a port.

func (*Client) GetBridgeWithName

func (c *Client) GetBridgeWithName(ctx context.Context, name string) (*ovsmodel.Bridge, error)

GetBridgeWithName gets a bridge by name. Returns ErrNotFound if the bridge is not found.

func (*Client) GetIfaceWithExternalIDs

func (c *Client) GetIfaceWithExternalIDs(ctx context.Context, externalIDs map[string]string) (*ovsmodel.Interface, error)

func (*Client) GetIfaceWithName

func (c *Client) GetIfaceWithName(ctx context.Context, name string) (*ovsmodel.Interface, error)

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 (c *Client) GetOpenVSwitch(ctx context.Context) (*ovsmodel.OpenvSwitch, error)

func (*Client) GetOpenVSwitchExternalIDs

func (c *Client) GetOpenVSwitchExternalIDs(ctx context.Context) (map[string]string, error)

func (*Client) GetPortVLANState

func (c *Client) GetPortVLANState(ctx context.Context, name string) (PortVLANState, error)

GetPortVLANState returns the VLAN configuration for an OVS port.

func (*Client) IsIfaceInBr

func (c *Client) IsIfaceInBr(ctx context.Context, bridgeName, portName string) (bool, error)

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

func (c *Client) ListInterfacesWithError(ctx context.Context) ([]string, error)

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

func (c *Client) SetIfaceOptions(ctx context.Context, name string, options map[string]string) error

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 (c *Client) SetOpenVSwitchExternalIDs(ctx context.Context, externalIDs map[string]string) error

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.

func (*Client) ValidateBridgeExists

func (c *Client) ValidateBridgeExists(ctx context.Context, bridgeName string) error

ValidateBridgeExists returns an error if bridgeName is missing in OVS.

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) Cache

func (m *MockAPI) Cache() *cache.TableCache

Cache mocks base method.

func (*MockAPI) Close

func (m *MockAPI) Close()

Close mocks base method.

func (*MockAPI) Connect

func (m *MockAPI) Connect(arg0 context.Context) error

Connect mocks base method.

func (*MockAPI) Connected

func (m *MockAPI) Connected() bool

Connected mocks base method.

func (*MockAPI) Create

func (m *MockAPI) Create(arg0 ...model.Model) ([]ovsdb.Operation, error)

Create mocks base method.

func (*MockAPI) CurrentEndpoint

func (m *MockAPI) CurrentEndpoint() string

CurrentEndpoint mocks base method.

func (*MockAPI) DelPort

func (m *MockAPI) DelPort(ctx context.Context, bridgeName, portName string, opt *DelPortOpt) error

DelPort mocks base method.

func (*MockAPI) DeleteBridge

func (m *MockAPI) DeleteBridge(ctx context.Context, name string) error

DeleteBridge mocks base method.

func (*MockAPI) Disconnect

func (m *MockAPI) Disconnect()

Disconnect 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) Echo

func (m *MockAPI) Echo(arg0 context.Context) error

Echo mocks base method.

func (*MockAPI) Get

func (m *MockAPI) Get(arg0 context.Context, arg1 model.Model) error

Get mocks base method.

func (*MockAPI) GetBridgeNameByInterface

func (m *MockAPI) GetBridgeNameByInterface(ctx context.Context, name string) (string, error)

GetBridgeNameByInterface mocks base method.

func (*MockAPI) GetBridgeNameByPort

func (m *MockAPI) GetBridgeNameByPort(ctx context.Context, name string) (string, error)

GetBridgeNameByPort mocks base method.

func (*MockAPI) GetBridgeWithName

func (m *MockAPI) GetBridgeWithName(ctx context.Context, name string) (*ovsmodel.Bridge, error)

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

func (m *MockAPI) GetIfaceWithName(ctx context.Context, name string) (*ovsmodel.Interface, error)

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

func (m *MockAPI) GetOpenVSwitchExternalIDs(ctx context.Context) (map[string]string, error)

GetOpenVSwitchExternalIDs mocks base method.

func (*MockAPI) GetPortVLANState

func (m *MockAPI) GetPortVLANState(ctx context.Context, name string) (PortVLANState, error)

GetPortVLANState mocks base method.

func (*MockAPI) IsIfaceInBr

func (m *MockAPI) IsIfaceInBr(ctx context.Context, bridgeName, portName string) (bool, error)

IsIfaceInBr mocks base method.

func (*MockAPI) List

func (m *MockAPI) List(ctx context.Context, result any) error

List 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

func (m *MockAPI) ListInterfacesWithError(ctx context.Context) ([]string, error)

ListInterfacesWithError mocks base method.

func (*MockAPI) Monitor

func (m *MockAPI) Monitor(arg0 context.Context, arg1 *client.Monitor) (client.MonitorCookie, error)

Monitor mocks base method.

func (*MockAPI) MonitorAll

func (m *MockAPI) MonitorAll(arg0 context.Context) (client.MonitorCookie, error)

MonitorAll mocks base method.

func (*MockAPI) MonitorCancel

func (m *MockAPI) MonitorCancel(ctx context.Context, cookie client.MonitorCookie) error

MonitorCancel mocks base method.

func (*MockAPI) NewMonitor

func (m *MockAPI) NewMonitor(arg0 ...client.MonitorOption) *client.Monitor

NewMonitor mocks base method.

func (*MockAPI) Schema

func (m *MockAPI) Schema() ovsdb.DatabaseSchema

Schema 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) SetOption

func (m *MockAPI) SetOption(arg0 client.Option) error

SetOption 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

func (m *MockAPI) UpdateEndpoints(arg0 []string)

UpdateEndpoints mocks base method.

func (*MockAPI) ValidateBridgeExists

func (m *MockAPI) ValidateBridgeExists(ctx context.Context, bridgeName string) error

ValidateBridgeExists mocks base method.

func (*MockAPI) Where

func (m *MockAPI) Where(arg0 ...model.Model) client.ConditionalAPI

Where mocks base method.

func (*MockAPI) WhereAll

func (m *MockAPI) WhereAll(arg0 model.Model, arg1 ...model.Condition) client.ConditionalAPI

WhereAll mocks base method.

func (*MockAPI) WhereAny

func (m *MockAPI) WhereAny(arg0 model.Model, arg1 ...model.Condition) client.ConditionalAPI

WhereAny 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) Cache

func (m *MockClient) Cache() *cache.TableCache

Cache mocks base method.

func (*MockClient) Close

func (m *MockClient) Close()

Close mocks base method.

func (*MockClient) Connect

func (m *MockClient) Connect(arg0 context.Context) error

Connect mocks base method.

func (*MockClient) Connected

func (m *MockClient) Connected() bool

Connected mocks base method.

func (*MockClient) Create

func (m *MockClient) Create(arg0 ...model.Model) ([]ovsdb.Operation, error)

Create mocks base method.

func (*MockClient) CurrentEndpoint

func (m *MockClient) CurrentEndpoint() string

CurrentEndpoint mocks base method.

func (*MockClient) Disconnect

func (m *MockClient) Disconnect()

Disconnect 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) Get

func (m *MockClient) Get(arg0 context.Context, arg1 model.Model) error

Get 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

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.

func (*MockConditionalAPI) Update

func (m *MockConditionalAPI) Update(arg0 model.Model, arg1 ...any) ([]ovsdb.Operation, error)

Update mocks base method.

func (*MockConditionalAPI) Wait

func (m *MockConditionalAPI) Wait(arg0 ovsdb.WaitCondition, arg1 *int, arg2 model.Model, arg3 ...any) ([]ovsdb.Operation, error)

Wait mocks base method.

type MockConditionalAPIMockRecorder

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

MockConditionalAPIMockRecorder is the mock recorder for MockConditionalAPI.

func (*MockConditionalAPIMockRecorder) Delete

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.

func (*MockConditionalAPIMockRecorder) Update

func (mr *MockConditionalAPIMockRecorder) Update(arg0 any, arg1 ...any) *gomock.Call

Update indicates an expected call of Update.

func (*MockConditionalAPIMockRecorder) Wait

func (mr *MockConditionalAPIMockRecorder) Wait(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call

Wait indicates an expected call of Wait.

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.

Jump to

Keyboard shortcuts

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