vpp

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: 26 Imported by: 0

Documentation

Overview

Package vpp handles the VPP instance.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStatsUnavailable = errors.New("Stats unavailable")
	ErrAPIUnavailable   = errors.New("API unavailable")
	ErrCLIUnavailable   = errors.New("CLI unavailable")
)

Functions

func DumpLogsCLI

func DumpLogsCLI(cli probe.CliExecutor) ([]string, error)

func DumpStats added in v0.2.0

func DumpStats(stats govppapi.StatsProvider) (*api.VppStats, error)

func GetClockCLI added in v0.2.0

func GetClockCLI(cli probe.CliExecutor) (time.Time, error)

func GetPidCLI

func GetPidCLI(cli probe.CliExecutor) (int, error)

func GetUptimeCLI

func GetUptimeCLI(cli probe.CliExecutor) (time.Duration, error)

func ListStats

func ListStats(stats govppapi.StatsProvider) ([]string, error)

func ShowPluginsCLI

func ShowPluginsCLI(cli probe.CliExecutor) ([]api.Plugin, error)

Types

type APIStatus

type APIStatus struct {
	CLI      Status
	BinAPI   Status
	StatsAPI Status
	LastErr  error
}

func (APIStatus) String

func (s APIStatus) String() string

type ClockData added in v0.2.0

type ClockData struct {
	Uptime string
	Clock  string
}

func ShowClockCLI added in v0.2.0

func ShowClockCLI(cli probe.CliExecutor) (*ClockData, error)

type Instance

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

Instance handles access to a running VPP instance.

func NewInstance

func NewInstance(probe probe.Handler) (*Instance, error)

NewInstance tries to initialize probe and returns a new Instance on success.

func (*Instance) Agent

func (v *Instance) Agent() *agent.Instance

func (*Instance) DumpLogs

func (v *Instance) DumpLogs() ([]string, error)

func (*Instance) DumpStats added in v0.2.0

func (v *Instance) DumpStats() (*api.VppStats, error)

func (*Instance) GetBuildInfo

func (v *Instance) GetBuildInfo() (*api.BuildInfo, error)

func (*Instance) GetLogs

func (v *Instance) GetLogs(since time.Time) ([]string, error)

func (*Instance) GetSystemInfo

func (v *Instance) GetSystemInfo() (*api.RuntimeInfo, error)

func (*Instance) GetUptime

func (v *Instance) GetUptime() (time.Duration, error)

func (*Instance) GetVersion

func (v *Instance) GetVersion() (string, error)

func (*Instance) Handler

func (v *Instance) Handler() probe.Handler

func (*Instance) ID

func (v *Instance) ID() string

func (*Instance) Init

func (v *Instance) Init() (err error)

func (*Instance) ListInterfaces

func (v *Instance) ListInterfaces() ([]*api.Interface, error)

func (*Instance) ListStats

func (v *Instance) ListStats() ([]string, error)

func (*Instance) MarshalJSON

func (v *Instance) MarshalJSON() ([]byte, error)

func (*Instance) RunCli

func (v *Instance) RunCli(cmd string) (string, error)

func (*Instance) Status

func (v *Instance) Status() *APIStatus

func (Instance) String

func (v Instance) String() string

func (*Instance) UnmarshalJSON

func (v *Instance) UnmarshalJSON(data []byte) error

func (*Instance) VppInfo

func (v *Instance) VppInfo() api.VppInfo

func (*Instance) VppInterfaces added in v0.2.0

func (v *Instance) VppInterfaces() []*api.Interface

func (*Instance) VppStats added in v0.2.0

func (v *Instance) VppStats() *api.VppStats

type State

type State int
const (
	StateUnknown State = iota
	StateChecking
	StateOK
	StateError
)

func (State) MarshalJSON

func (s State) MarshalJSON() ([]byte, error)

func (State) String

func (s State) String() string

func (*State) UnmarshalJSON

func (s *State) UnmarshalJSON(data []byte) error

type Status

type Status struct {
	State State
	Err   error
}

func (Status) MarshalJSON

func (s Status) MarshalJSON() ([]byte, error)

func (*Status) SetError

func (s *Status) SetError(err error)

func (Status) String

func (s Status) String() string

type VersionVerboseData

type VersionVerboseData struct {
	Version         string
	CompiledBy      string
	CompileHost     string
	CompileDate     string
	CompileLocation string
	Compiler        string
	CurrentPID      string
}

func ShowVersionVerboseCLI

func ShowVersionVerboseCLI(cli probe.CliExecutor) (*VersionVerboseData, error)

Directories

Path Synopsis
Package agent handles VPP-Agent instance data.
Package agent handles VPP-Agent instance data.

Jump to

Keyboard shortcuts

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