summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2019-11-15 12:33:28 +0100
committerOndrej Fabry <ofabry@cisco.com>2019-11-15 12:33:28 +0100
commite45d8802fd8de3602db630d75b370ff804000da9 (patch)
tree8803fe98338b4ed196d4c8881624c7ba869b9e53 /examples
parent2f75863ba9bff2d2f3488b70e441b5eefc91dfd2 (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 'examples')
-rw-r--r--examples/rpc-service/rpc_service.go4
-rw-r--r--examples/simple-client/simple_client.go4
2 files changed, 6 insertions, 2 deletions
diff --git a/examples/rpc-service/rpc_service.go b/examples/rpc-service/rpc_service.go
index ca0c295..8ff6c08 100644
--- a/examples/rpc-service/rpc_service.go
+++ b/examples/rpc-service/rpc_service.go
@@ -17,12 +17,12 @@
package main
import (
- "bytes"
"context"
"flag"
"fmt"
"io"
"log"
+ "strings"
"git.fd.io/govpp.git"
"git.fd.io/govpp.git/adapter/socketclient"
@@ -88,6 +88,6 @@ func interfaceDump(ch api.Channel) {
if err != nil {
log.Fatalln("ERROR: DumpSwInterface failed:", err)
}
- fmt.Printf("- interface: %s\n", bytes.Trim(iface.InterfaceName, "\x00"))
+ fmt.Printf("- interface: %s\n", strings.Trim(iface.InterfaceName, "\x00"))
}
}
diff --git a/examples/simple-client/simple_client.go b/examples/simple-client/simple_client.go
index 3a24e6a..3ed811d 100644
--- a/examples/simple-client/simple_client.go
+++ b/examples/simple-client/simple_client.go
@@ -65,6 +65,10 @@ func main() {
vppVersion(ch)
+ if err := ch.CheckCompatiblity(interfaces.AllMessages()...); err != nil {
+ log.Fatal(err)
+ }
+
createLoopback(ch)
createLoopback(ch)
interfaceDump(ch)