socketclient

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package socketclient is a pure Go implementation of adapter.VppAPI, which uses unix domain sockets as the transport for connecting to the VPP binary API.

The current implementation only supports VPP binary API, the VPP stats API is not supported and clients still have to use vppapiclient for retrieving stats.

Requirements

The socketclient will connect to /run/vpp-api.sock by default. However this is not enabled in VPP configuration by default.

To enable the socket in VPP, add following section to VPP config.

socksvr {
	default
}

Index

Constants

View Source
const (
	// DefaultSocketName is default VPP API socket file path.
	DefaultSocketName = adapter.DefaultBinapiSocket
)

Variables

View Source
var (
	// DefaultConnectTimeout is default timeout for connecting
	DefaultConnectTimeout = time.Second * 3
	// DefaultDisconnectTimeout is default timeout for discconnecting
	DefaultDisconnectTimeout = time.Millisecond * 100
	// MaxWaitReady defines maximum duration before waiting for socket file
	// times out
	MaxWaitReady = time.Second * 15
	// ClientName is used for identifying client in socket registration
	ClientName = "govppsock"
)
View Source
var (
	// Debug is global variable that determines debug mode
	Debug = os.Getenv("DEBUG_GOVPP_SOCK") != ""
	// DebugMsgIds is global variable that determines debug mode for msg ids
	DebugMsgIds = os.Getenv("DEBUG_GOVPP_SOCKMSG") != ""

	// Log is global logger
	Log = logger.New()
)

Functions

func NewVppClient

func NewVppClient(sockAddr string) *vppClient

Types

This section is empty.

Jump to

Keyboard shortcuts

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