Documentation ¶
Overview ¶
Package govppmux implements the GoVPPMux plugin that allows multiple plugins to share a single connection to VPP.
Index ¶
- Variables
- func NewStatsAdapter(socketName string) adapter.StatsAPI
- func NewVppAdapter(shmPrefix string) adapter.VppAPI
- type API
- type Config
- type Deps
- type Option
- type Plugin
- func (plugin *Plugin) Close() error
- func (plugin *Plugin) DumpStats(prefixes ...string) ([]*adapter.StatEntry, error)
- func (plugin *Plugin) GetErrorStats(names ...string) (*govppapi.ErrorStats, error)
- func (plugin *Plugin) GetInterfaceStats() (*govppapi.InterfaceStats, error)
- func (plugin *Plugin) GetNodeStats() (*govppapi.NodeStats, error)
- func (plugin *Plugin) GetSystemStats() (*govppapi.SystemStats, error)
- func (plugin *Plugin) GetTrace() *apitrace.Trace
- func (plugin *Plugin) Init() error
- func (plugin *Plugin) ListStats(prefixes ...string) ([]string, error)
- func (plugin *Plugin) NewAPIChannel() (govppapi.Channel, error)
- func (plugin *Plugin) NewAPIChannelBuffered(reqChanBufSize, replyChanBufSize int) (govppapi.Channel, error)
- type StatsAPI
- type TraceAPI
Constants ¶
This section is empty.
Variables ¶
var DefaultPlugin = *NewPlugin()
DefaultPlugin is default instance of Plugin
Functions ¶
func NewStatsAdapter ¶ added in v1.8.1
NewStatsAdapter returns stats vpp api adapter, used for reading statistics with vppapiclient library.
func NewVppAdapter ¶ added in v1.4.0
NewVppAdapter returns real vpp api adapter, used for building with vppapiclient library.
Types ¶
type API ¶ added in v1.0.4
type API interface { // NewAPIChannel returns a new API channel for communication with VPP via govpp core. // It uses default buffer sizes for the request and reply Go channels. // // Example of binary API call from some plugin using GOVPP: // ch, _ := govpp_mux.NewAPIChannel() // ch.SendRequest(req).ReceiveReply NewAPIChannel() (govppapi.Channel, error) // NewAPIChannelBuffered returns a new API channel for communication with VPP via govpp core. // It allows to specify custom buffer sizes for the request and reply Go channels. // // Example of binary API call from some plugin using GOVPP: // ch, _ := govpp_mux.NewAPIChannelBuffered(100, 100) // ch.SendRequest(req).ReceiveReply NewAPIChannelBuffered(reqChanBufSize, replyChanBufSize int) (govppapi.Channel, error) }
API for other plugins to get connectivity to VPP.
type Config ¶ added in v1.0.5
type Config struct { TraceEnabled bool `json:"trace-enabled"` HealthCheckProbeInterval time.Duration `json:"health-check-probe-interval"` HealthCheckReplyTimeout time.Duration `json:"health-check-reply-timeout"` HealthCheckThreshold int `json:"health-check-threshold"` ReplyTimeout time.Duration `json:"reply-timeout"` // The prefix prepended to the name used for shared memory (SHM) segments. If not set, // shared memory segments are created directly in the SHM directory /dev/shm. ShmPrefix string `json:"shm-prefix"` StatsSocketName string `json:"stats-socket-name"` ReconnectResync bool `json:"resync-after-reconnect"` // How many times can be request resent in case vpp is suddenly disconnected. RetryRequestCount int `json:"retry-request-count"` // Time between request resend attempts. Default is 500ms. RetryRequestTimeout time.Duration `json:"retry-request-timeout"` }
Config groups the configurable parameter of GoVpp.
type Deps ¶ added in v1.0.2
type Deps struct { infra.PluginDeps StatusCheck statuscheck.PluginStatusWriter Resync *resync.Plugin }
Deps groups injected dependencies of plugin so that they do not mix with other plugin fields.
type Option ¶ added in v1.8.1
type Option func(*Plugin)
Option is a function that acts on a Plugin to inject Dependencies or configuration
type Plugin ¶ added in v1.8.1
type Plugin struct { Deps // contains filtered or unexported fields }
Plugin implements the govppmux plugin interface.
func (*Plugin) Close ¶ added in v1.8.1
Close cleans up the resources allocated by the govppmux plugin.
func (*Plugin) GetErrorStats ¶ added in v1.8.1
func (plugin *Plugin) GetErrorStats(names ...string) (*govppapi.ErrorStats, error)
GetErrorStats retrieves VPP error counters
func (*Plugin) GetInterfaceStats ¶ added in v1.8.1
func (plugin *Plugin) GetInterfaceStats() (*govppapi.InterfaceStats, error)
GetInterfaceStats retrieves all counters related to the VPP interfaces
func (*Plugin) GetNodeStats ¶ added in v1.8.1
GetNodeStats retrieves a list of Node VPP counters (vectors, clocks, ...)
func (*Plugin) GetSystemStats ¶ added in v1.8.1
func (plugin *Plugin) GetSystemStats() (*govppapi.SystemStats, error)
GetSystemStats retrieves system statistics of the connected VPP instance like Vector rate, Input rate, etc.
func (*Plugin) Init ¶ added in v1.8.1
Init is the entry point called by Agent Core. A single binary-API connection to VPP is established.
func (*Plugin) NewAPIChannel ¶ added in v1.8.1
NewAPIChannel returns a new API channel for communication with VPP via govpp core. It uses default buffer sizes for the request and reply Go channels.
Example of binary API call from some plugin using GOVPP:
ch, _ := govpp_mux.NewAPIChannel() ch.SendRequest(req).ReceiveReply
func (*Plugin) NewAPIChannelBuffered ¶ added in v1.8.1
func (plugin *Plugin) NewAPIChannelBuffered(reqChanBufSize, replyChanBufSize int) (govppapi.Channel, error)
NewAPIChannelBuffered returns a new API channel for communication with VPP via govpp core. It allows to specify custom buffer sizes for the request and reply Go channels.
Example of binary API call from some plugin using GOVPP:
ch, _ := govpp_mux.NewAPIChannelBuffered(100, 100) ch.SendRequest(req).ReceiveReply
type StatsAPI ¶ added in v1.8.1
type StatsAPI interface { API // ListStats returns all stats names present on the VPP. Patterns can be used as a prefix // to filter the output ListStats(patterns ...string) ([]string, error) // ListStats returns all stats names, types and values from the VPP. Patterns can be used as a prefix // to filter the output. Stats are divided between workers. Example: // // stats values: {{0, 20, 30}{0, 0, 10}} // // It means there are three interfaces on two workers (inner arrays, array index == sw_if_index), // and statistics are like following: // // 0 for sw_if_index 0 // 20 for sw_if_index 1 // 40 for sw_if_index 2 (sum of stats from all workers) // DumpStats(patterns ...string) ([]*adapter.StatEntry, error) // GetSystemStats retrieves system statistics of the connected VPP instance like Vector rate, Input rate, etc. GetSystemStats() (*govppapi.SystemStats, error) // GetNodeStats retrieves a list of Node VPP counters (vectors, clocks, ...) GetNodeStats() (*govppapi.NodeStats, error) // GetInterfaceStats retrieves all counters related to the VPP interfaces GetInterfaceStats() (*govppapi.InterfaceStats, error) // GetErrorStats retrieves VPP error counters GetErrorStats(names ...string) (*govppapi.ErrorStats, error) }
StatsAPI is extended API with ability to get VPP stats data