Fix encoding for float64 and generate conversion for Timestamp
[govpp.git] / examples / simple-client / simple_client.go
index 0898c0a..10a0ea6 100644 (file)
@@ -84,6 +84,7 @@ func main() {
 
        // use request/reply (channel API)
        getVppVersion(ch)
+       getSystemTime(ch)
        idx := createLoopback(ch)
        interfaceDump(ch)
        addIPAddress(ch, idx)
@@ -107,6 +108,22 @@ func getVppVersion(ch api.Channel) {
        fmt.Println()
 }
 
+func getSystemTime(ch api.Channel) {
+       fmt.Println("Retrieving system time..")
+
+       req := &vpe.ShowVpeSystemTime{}
+       reply := &vpe.ShowVpeSystemTimeReply{}
+
+       if err := ch.SendRequest(req).ReceiveReply(reply); err != nil {
+               logError(err, "retrieving system time")
+               return
+       }
+
+       fmt.Printf("system time: %v\n", reply.VpeSystemTime)
+       fmt.Println("OK")
+       fmt.Println()
+}
+
 func createLoopback(ch api.Channel) interface_types.InterfaceIndex {
        fmt.Println("Creating loopback interface..")