openflow

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: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package openflow is a generated GoMock package.

Package openflow is a generated GoMock package.

Package openflow is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockCmd

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

MockCmd is a mock of Cmd interface.

func NewMockCmd

func NewMockCmd(ctrl *gomock.Controller) *MockCmd

NewMockCmd creates a new mock instance.

func (*MockCmd) CombinedOutput

func (m *MockCmd) CombinedOutput() ([]byte, error)

CombinedOutput mocks base method.

func (*MockCmd) EXPECT

func (m *MockCmd) EXPECT() *MockCmdMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCmd) Output

func (m *MockCmd) Output() ([]byte, error)

Output mocks base method.

func (*MockCmd) Run

func (m *MockCmd) Run() error

Run mocks base method.

func (*MockCmd) SetDir

func (m *MockCmd) SetDir(dir string)

SetDir mocks base method.

func (*MockCmd) SetEnv

func (m *MockCmd) SetEnv(env []string)

SetEnv mocks base method.

func (*MockCmd) SetStderr

func (m *MockCmd) SetStderr(out io.Writer)

SetStderr mocks base method.

func (*MockCmd) SetStdin

func (m *MockCmd) SetStdin(in io.Reader)

SetStdin mocks base method.

func (*MockCmd) SetStdout

func (m *MockCmd) SetStdout(out io.Writer)

SetStdout mocks base method.

func (*MockCmd) Start

func (m *MockCmd) Start() error

Start mocks base method.

func (*MockCmd) StderrPipe

func (m *MockCmd) StderrPipe() (io.ReadCloser, error)

StderrPipe mocks base method.

func (*MockCmd) StdoutPipe

func (m *MockCmd) StdoutPipe() (io.ReadCloser, error)

StdoutPipe mocks base method.

func (*MockCmd) Stop

func (m *MockCmd) Stop()

Stop mocks base method.

func (*MockCmd) Wait

func (m *MockCmd) Wait() error

Wait mocks base method.

type MockCmdMockRecorder

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

MockCmdMockRecorder is the mock recorder for MockCmd.

func (*MockCmdMockRecorder) CombinedOutput

func (mr *MockCmdMockRecorder) CombinedOutput() *gomock.Call

CombinedOutput indicates an expected call of CombinedOutput.

func (*MockCmdMockRecorder) Output

func (mr *MockCmdMockRecorder) Output() *gomock.Call

Output indicates an expected call of Output.

func (*MockCmdMockRecorder) Run

func (mr *MockCmdMockRecorder) Run() *gomock.Call

Run indicates an expected call of Run.

func (*MockCmdMockRecorder) SetDir

func (mr *MockCmdMockRecorder) SetDir(dir any) *gomock.Call

SetDir indicates an expected call of SetDir.

func (*MockCmdMockRecorder) SetEnv

func (mr *MockCmdMockRecorder) SetEnv(env any) *gomock.Call

SetEnv indicates an expected call of SetEnv.

func (*MockCmdMockRecorder) SetStderr

func (mr *MockCmdMockRecorder) SetStderr(out any) *gomock.Call

SetStderr indicates an expected call of SetStderr.

func (*MockCmdMockRecorder) SetStdin

func (mr *MockCmdMockRecorder) SetStdin(in any) *gomock.Call

SetStdin indicates an expected call of SetStdin.

func (*MockCmdMockRecorder) SetStdout

func (mr *MockCmdMockRecorder) SetStdout(out any) *gomock.Call

SetStdout indicates an expected call of SetStdout.

func (*MockCmdMockRecorder) Start

func (mr *MockCmdMockRecorder) Start() *gomock.Call

Start indicates an expected call of Start.

func (*MockCmdMockRecorder) StderrPipe

func (mr *MockCmdMockRecorder) StderrPipe() *gomock.Call

StderrPipe indicates an expected call of StderrPipe.

func (*MockCmdMockRecorder) StdoutPipe

func (mr *MockCmdMockRecorder) StdoutPipe() *gomock.Call

StdoutPipe indicates an expected call of StdoutPipe.

func (*MockCmdMockRecorder) Stop

func (mr *MockCmdMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop.

func (*MockCmdMockRecorder) Wait

func (mr *MockCmdMockRecorder) Wait() *gomock.Call

Wait indicates an expected call of Wait.

type MockInterface

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

MockInterface is a mock of Interface interface.

func NewMockInterface

func NewMockInterface(ctrl *gomock.Controller) *MockInterface

NewMockInterface creates a new mock instance.

func (*MockInterface) Command

func (m *MockInterface) Command(cmd string, args ...string) exec.Cmd

Command mocks base method.

func (*MockInterface) CommandContext

func (m *MockInterface) CommandContext(ctx context.Context, cmd string, args ...string) exec.Cmd

CommandContext mocks base method.

func (*MockInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockInterface) LookPath

func (m *MockInterface) LookPath(file string) (string, error)

LookPath mocks base method.

type MockInterfaceMockRecorder

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

MockInterfaceMockRecorder is the mock recorder for MockInterface.

func (*MockInterfaceMockRecorder) Command

func (mr *MockInterfaceMockRecorder) Command(cmd any, args ...any) *gomock.Call

Command indicates an expected call of Command.

func (*MockInterfaceMockRecorder) CommandContext

func (mr *MockInterfaceMockRecorder) CommandContext(ctx, cmd any, args ...any) *gomock.Call

CommandContext indicates an expected call of CommandContext.

func (*MockInterfaceMockRecorder) LookPath

func (mr *MockInterfaceMockRecorder) LookPath(file any) *gomock.Call

LookPath indicates an expected call of LookPath.

type MockOpenFlowAPI

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

MockOpenFlowAPI is a mock of OpenFlowAPI interface.

func NewMockOpenFlowAPI

func NewMockOpenFlowAPI(ctrl *gomock.Controller) *MockOpenFlowAPI

NewMockOpenFlowAPI creates a new mock instance.

func (*MockOpenFlowAPI) AddFlows

func (m *MockOpenFlowAPI) AddFlows(ctx context.Context, flows, bridgeName string) error

AddFlows mocks base method.

func (*MockOpenFlowAPI) AddMeter

func (m *MockOpenFlowAPI) AddMeter(ctx context.Context, meter, bridgeName string) error

AddMeter mocks base method.

func (*MockOpenFlowAPI) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockOpenFlowAPIMockRecorder

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

MockOpenFlowAPIMockRecorder is the mock recorder for MockOpenFlowAPI.

func (*MockOpenFlowAPIMockRecorder) AddFlows

func (mr *MockOpenFlowAPIMockRecorder) AddFlows(ctx, flows, bridgeName any) *gomock.Call

AddFlows indicates an expected call of AddFlows.

func (*MockOpenFlowAPIMockRecorder) AddMeter

func (mr *MockOpenFlowAPIMockRecorder) AddMeter(ctx, meter, bridgeName any) *gomock.Call

AddMeter indicates an expected call of AddMeter.

type OpenFlow

type OpenFlow struct {
	Exec         kexec.Interface
	OVSOfctlPath string
	BridgeName   string
	// contains filtered or unexported fields
}

func (*OpenFlow) AddFlows

func (f *OpenFlow) AddFlows(ctx context.Context, flows, bridgeName string) (err error)

AddFlows adds flows to the OpenFlow switch. Utility function which takes in a multiline string called flows Creates a temporary file on the system and writes the aforementioned string. This will file will be consumed by ovs-ofctl command with the bundle argument to ensure the fact that all flows are added in an atomic operation

func (*OpenFlow) AddMeter

func (f *OpenFlow) AddMeter(ctx context.Context, meterConf, bridgeName string) error

AddMeter adds a meter to a given switch. This is a wrapper over a cmdcall to the utility ovs-ofctl which allows adding only one meter at a time. This functionality is supported from OpenFlow version 1.3 and above.

type OpenFlowAPI

type OpenFlowAPI interface {
	AddFlows(ctx context.Context, flows, bridgeName string) error
	AddMeter(ctx context.Context, meter, bridgeName string) error
}

Jump to

Keyboard shortcuts

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