Introduce StatsAPI and it's initial implementation
[govpp.git] / adapter / vpp_api.go
similarity index 84%
rename from adapter/adapter.go
rename to adapter/vpp_api.go
index aa34329..7d14633 100644 (file)
@@ -24,16 +24,17 @@ var ErrNotImplemented = errors.New("not implemented for this OS")
 // MsgCallback defines func signature for message callback.
 type MsgCallback func(msgID uint16, data []byte)
 
-// VppAdapter provides connection to VPP. It is responsible for sending and receiving of binary-encoded messages to/from VPP.
-type VppAdapter interface {
+// VppAPI provides connection to VPP binary API.
+// It is responsible for sending and receiving of binary-encoded messages to/from VPP.
+type VppAPI interface {
        // Connect connects the process to VPP.
        Connect() error
 
        // Disconnect disconnects the process from VPP.
-       Disconnect()
+       Disconnect() error
 
        // GetMsgID returns a runtime message ID for the given message name and CRC.
-       GetMsgID(msgName string, msgCrc string) (uint16, error)
+       GetMsgID(msgName string, msgCrc string) (msgID uint16, err error)
 
        // SendMsg sends a binary-encoded message to VPP.
        SendMsg(context uint32, data []byte) error