Documentation
¶
Overview ¶
Package govppmux implements the GoVPPMux plugin that allows multiple plugins to share a single connection to VPP.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultPlugin = *NewPlugin()
DefaultPlugin is default instance of Plugin
Functions ¶
Types ¶
type API ¶
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 ¶
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"` 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 ¶
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 ¶
type Option func(*Plugin)
Option is a function that acts on a Plugin to inject Dependencies or configuration
type Plugin ¶
type Plugin struct { Deps // contains filtered or unexported fields }
Plugin implements the govppmux plugin interface.
func NewPlugin ¶
NewPlugin creates a new Plugin with the provides Options
func (*Plugin) Close ¶
Close cleans up the resources allocated by the govppmux plugin.
func (*Plugin) GetTrace ¶
GetTrace returns all trace entries measured so far
func (*Plugin) Init ¶
Init is the entry point called by Agent Core. A single binary-API connection to VPP is established.
func (*Plugin) NewAPIChannel ¶
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 ¶
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
Source Files
¶
- adapter_vppapiclient.go
- doc.go
- govpp_channel.go
- options.go
- plugin_api_govppmux.go
- plugin_impl_govppmux.go