make api.Channel as interface
[govpp.git] / examples / cmd / stats-client / stats_client.go
index e0c4463..5f9966f 100644 (file)
@@ -27,15 +27,15 @@ import (
        "git.fd.io/govpp.git"
        "git.fd.io/govpp.git/api"
        "git.fd.io/govpp.git/core"
-       "git.fd.io/govpp.git/core/bin_api/vpe"
        "git.fd.io/govpp.git/examples/bin_api/interfaces"
+       "git.fd.io/govpp.git/examples/bin_api/stats"
 )
 
 func main() {
        fmt.Println("Starting stats VPP client...")
 
        // async connect to VPP
-       conn, statCh, err := govpp.AsyncConnect()
+       conn, statCh, err := govpp.AsyncConnect("")
        if err != nil {
                fmt.Println("Error:", err)
                os.Exit(1)
@@ -101,7 +101,7 @@ loop:
 }
 
 // subscribeNotifications subscribes for interface counters notifications.
-func subscribeNotifications(ch *api.Channel) (*api.NotifSubscription, *api.NotifSubscription, chan api.Message) {
+func subscribeNotifications(ch api.Channel) (*api.NotifSubscription, *api.NotifSubscription, chan api.Message) {
 
        notifChan := make(chan api.Message, 100)
        simpleCountersSubs, _ := ch.SubscribeNotification(notifChan, interfaces.NewVnetInterfaceSimpleCounters)
@@ -111,11 +111,11 @@ func subscribeNotifications(ch *api.Channel) (*api.NotifSubscription, *api.Notif
 }
 
 // requestStatistics requests interface counters notifications from VPP.
-func requestStatistics(ch *api.Channel) {
-       ch.SendRequest(&vpe.WantStats{
+func requestStatistics(ch api.Channel) {
+       ch.SendRequest(&stats.WantStats{
                Pid:           uint32(os.Getpid()),
                EnableDisable: 1,
-       }).ReceiveReply(&vpe.WantStatsReply{})
+       }).ReceiveReply(&stats.WantStatsReply{})
 }
 
 // processSimpleCounters processes simple counters received from VPP.