From ca17408be06a5e80e9c7a0ef226361b02f3b46e5 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Tue, 22 Sep 2015 01:31:20 -0700 Subject: [PATCH] Json tags to some structs were missing. Fix ServerRep reply on the server. --- rpc-definitions.go | 6 +++--- server-rpc.go | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/rpc-definitions.go b/rpc-definitions.go index 0273babee..741db7ca7 100644 --- a/rpc-definitions.go +++ b/rpc-definitions.go @@ -59,12 +59,12 @@ type DefaultRep struct { // ServerListRep collection of server replies type ServerListRep struct { - List []ServerRep + List []ServerRep `json:"list"` } // DiskStatsRep collection of disks type DiskStatsRep struct { - Disks []string + Disks []string `json:"disks"` } // MemStatsRep memory statistics of a server @@ -83,7 +83,7 @@ type Network struct { // NetStatsRep network statistics of a server type NetStatsRep struct { - Interfaces []Network + Interfaces []Network `json:"interfaces"` } // SysInfoRep system information of a server diff --git a/server-rpc.go b/server-rpc.go index 14b9a2395..7382d8983 100644 --- a/server-rpc.go +++ b/server-rpc.go @@ -27,10 +27,8 @@ import ( type serverRPCService struct{} func (s *serverRPCService) Add(r *http.Request, arg *ServerArg, rep *ServerRep) error { - rep = &ServerRep{ - Host: "192.168.1.1:9002", - ID: "6F27CB16-493D-40FA-B035-2A2E5646066A", - } + rep.Host = "192.168.1.1:9002" + rep.ID = "6F27CB16-493D-40FA-B035-2A2E5646066A" return nil }