vppcli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanOutput

func CleanOutput(out []byte) string

CleanOutput cleans the CLI output received from VPP: - converts line endings to (CR LF -> LF) - trim leading newlines (CR/LF) - strips banner until the prompt (one of random VPP bugs)

Types

type CmdExecutor

type CmdExecutor struct {
	Cmd  string
	Args []string
}

CmdExecutor provides access to CLI by executing it via external command.

func NewCmdExecutor

func NewCmdExecutor(cmd string, args ...string) *CmdExecutor

NewCmdExecutor returns a new CmdExecutor.

func (*CmdExecutor) RunCli

func (ctx *CmdExecutor) RunCli(cmd string) (string, error)

RunCli executes CLI command and returns the response or error.

type ExecutorFunc

type ExecutorFunc func(cmd string) (string, error)

ExecutorFunc is a helper type for implementing the Executor from function.

func (ExecutorFunc) RunCli

func (f ExecutorFunc) RunCli(cmd string) (string, error)

Jump to

Keyboard shortcuts

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