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 ¶
const ( // DefaultSocketName is default VPP API socket file path. DefaultSocketName = adapter.DefaultBinapiSocket )
Variables ¶
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 * 10 // ClientName is used for identifying client in socket registration ClientName = "govppsock" )
Functions ¶
func NewVppClient ¶
func NewVppClient(sockAddr string) *vppClient
Types ¶
type APIVersions ¶ added in v0.3.7
type APIVersions struct{}
APIVersions represents VPP binary API message 'api_versions'.
func (*APIVersions) GetCrcString ¶ added in v0.3.7
func (*APIVersions) GetCrcString() string
func (*APIVersions) GetMessageName ¶ added in v0.3.7
func (*APIVersions) GetMessageName() string
func (*APIVersions) GetMessageType ¶ added in v0.3.7
func (*APIVersions) GetMessageType() api.MessageType
type APIVersionsReply ¶ added in v0.3.7
type APIVersionsReply struct { Retval int32 Count uint32 `struc:"sizeof=APIVersions"` APIVersions []ModuleVersion }
APIVersionsReply represents VPP binary API message 'api_versions_reply'.
func (*APIVersionsReply) GetCrcString ¶ added in v0.3.7
func (*APIVersionsReply) GetCrcString() string
func (*APIVersionsReply) GetMessageName ¶ added in v0.3.7
func (*APIVersionsReply) GetMessageName() string
func (*APIVersionsReply) GetMessageType ¶ added in v0.3.7
func (*APIVersionsReply) GetMessageType() api.MessageType
type MessageTableEntry ¶ added in v0.3.7
MessageTableEntry represents VPP binary API type 'message_table_entry'.
func (*MessageTableEntry) GetTypeName ¶ added in v0.3.7
func (*MessageTableEntry) GetTypeName() string
type ModuleVersion ¶ added in v0.3.7
ModuleVersion represents VPP binary API type 'module_version'.
func (*ModuleVersion) GetTypeName ¶ added in v0.3.7
func (*ModuleVersion) GetTypeName() string
type SockclntCreate ¶ added in v0.3.7
type SockclntCreate struct {
Name string `struc:"[64]byte"`
}
SockclntCreate represents VPP binary API message 'sockclnt_create'.
func (*SockclntCreate) GetCrcString ¶ added in v0.3.7
func (*SockclntCreate) GetCrcString() string
func (*SockclntCreate) GetMessageName ¶ added in v0.3.7
func (*SockclntCreate) GetMessageName() string
func (*SockclntCreate) GetMessageType ¶ added in v0.3.7
func (*SockclntCreate) GetMessageType() api.MessageType
type SockclntCreateReply ¶ added in v0.3.7
type SockclntCreateReply struct { Response int32 Index uint32 Count uint16 `struc:"sizeof=MessageTable"` MessageTable []MessageTableEntry }
SockclntCreateReply represents VPP binary API message 'sockclnt_create_reply'.
func (*SockclntCreateReply) GetCrcString ¶ added in v0.3.7
func (*SockclntCreateReply) GetCrcString() string
func (*SockclntCreateReply) GetMessageName ¶ added in v0.3.7
func (*SockclntCreateReply) GetMessageName() string
func (*SockclntCreateReply) GetMessageType ¶ added in v0.3.7
func (*SockclntCreateReply) GetMessageType() api.MessageType
type SockclntDelete ¶ added in v0.3.7
type SockclntDelete struct {
Index uint32
}
SockclntDelete represents VPP binary API message 'sockclnt_delete'.
func (*SockclntDelete) GetCrcString ¶ added in v0.3.7
func (*SockclntDelete) GetCrcString() string
func (*SockclntDelete) GetMessageName ¶ added in v0.3.7
func (*SockclntDelete) GetMessageName() string
func (*SockclntDelete) GetMessageType ¶ added in v0.3.7
func (*SockclntDelete) GetMessageType() api.MessageType
type SockclntDeleteReply ¶ added in v0.3.7
type SockclntDeleteReply struct {
Response int32
}
SockclntDeleteReply represents VPP binary API message 'sockclnt_delete_reply'.
func (*SockclntDeleteReply) GetCrcString ¶ added in v0.3.7
func (*SockclntDeleteReply) GetCrcString() string
func (*SockclntDeleteReply) GetMessageName ¶ added in v0.3.7
func (*SockclntDeleteReply) GetMessageName() string
func (*SockclntDeleteReply) GetMessageType ¶ added in v0.3.7
func (*SockclntDeleteReply) GetMessageType() api.MessageType