diff options
author | Ondrej Fabry <ofabry@cisco.com> | 2019-11-15 12:33:28 +0100 |
---|---|---|
committer | Ondrej Fabry <ofabry@cisco.com> | 2019-11-15 12:33:28 +0100 |
commit | e45d8802fd8de3602db630d75b370ff804000da9 (patch) | |
tree | 8803fe98338b4ed196d4c8881624c7ba869b9e53 /adapter/vpp_api.go | |
parent | 2f75863ba9bff2d2f3488b70e441b5eefc91dfd2 (diff) |
Improve compatibility checking
- added CompatibilityError to api package to represent error with
list of incompatible messages
- added UnknownMsgError to adapter package to represent error for
unknown message
- added list of registered message types
Change-Id: I2623b45135521d52612ba91e4605fc064a7fc76e
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'adapter/vpp_api.go')
-rw-r--r-- | adapter/vpp_api.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/adapter/vpp_api.go b/adapter/vpp_api.go index 71bf7c2..b32f975 100644 --- a/adapter/vpp_api.go +++ b/adapter/vpp_api.go @@ -16,6 +16,7 @@ package adapter import ( "errors" + "fmt" ) const ( @@ -52,3 +53,14 @@ type VppAPI interface { // WaitReady waits until adapter is ready. WaitReady() error } + +// UnknownMsgError is the error type usually returned by GetMsgID +// method of VppAPI. It describes the name and CRC for the unknown message. +type UnknownMsgError struct { + MsgName string + MsgCrc string +} + +func (u *UnknownMsgError) Error() string { + return fmt.Sprintf("unknown message: %s_%s", u.MsgName, u.MsgCrc) +} |