diff --git a/pkg/server/router.go b/pkg/server/router.go index e3d387f7f..21339e7c6 100644 --- a/pkg/server/router.go +++ b/pkg/server/router.go @@ -117,9 +117,9 @@ func getAPIHandler(conf api.Config) (http.Handler, api.Minio) { func getRPCHandler() http.Handler { s := rpc.NewServer() s.RegisterJSONCodec() - s.RegisterService(new(rpc.VersionService), "") - s.RegisterService(new(rpc.GetSysInfoService), "") - s.RegisterService(new(rpc.GetDiskInfoService), "") + s.RegisterService(new(rpc.VersionService), "Version") + s.RegisterService(new(rpc.SysInfoService), "SysInfo") + s.RegisterService(new(rpc.DiskInfoService), "DiskInfo") // Add new services here return registerRPC(router.NewRouter(), s) } diff --git a/pkg/server/rpc/diskinfo.go b/pkg/server/rpc/diskinfo.go index a40c45e53..db036a561 100644 --- a/pkg/server/rpc/diskinfo.go +++ b/pkg/server/rpc/diskinfo.go @@ -24,17 +24,17 @@ import ( "github.com/minio/minio/pkg/utils/scsi" ) -// GetDiskInfoService disk info service -type GetDiskInfoService struct{} +// DiskInfoService disk info service +type DiskInfoService struct{} -// GetDiskInfoReply disk info reply for disk info service -type GetDiskInfoReply struct { +// DiskInfoReply disk info reply for disk info service +type DiskInfoReply struct { Hostname string `json:"hostname"` Disks []string `json:"disks"` DiskAttributes map[string]scsi.Attributes `json:"disk-attrs"` } -func setDiskInfoReply(sis *GetDiskInfoReply) error { +func setDiskInfoReply(sis *DiskInfoReply) error { var err error sis.Hostname, err = os.Hostname() if err != nil { @@ -53,6 +53,6 @@ func setDiskInfoReply(sis *GetDiskInfoReply) error { } // Get method -func (s *GetDiskInfoService) Get(r *http.Request, args *Args, reply *GetDiskInfoReply) error { +func (s *DiskInfoService) Get(r *http.Request, args *Args, reply *DiskInfoReply) error { return setDiskInfoReply(reply) } diff --git a/pkg/server/rpc/sysinfo.go b/pkg/server/rpc/sysinfo.go index e387306f3..e463faabf 100644 --- a/pkg/server/rpc/sysinfo.go +++ b/pkg/server/rpc/sysinfo.go @@ -24,11 +24,11 @@ import ( "github.com/minio/minio/pkg/iodine" ) -// GetSysInfoService - -type GetSysInfoService struct{} +// SysInfoService - +type SysInfoService struct{} -// GetSysInfoReply - -type GetSysInfoReply struct { +// SysInfoReply - +type SysInfoReply struct { Hostname string `json:"hostname"` SysARCH string `json:"sys.arch"` SysOS string `json:"sys.os"` @@ -38,7 +38,7 @@ type GetSysInfoReply struct { MemStats runtime.MemStats `json:"memstats"` } -func setSysInfoReply(sis *GetSysInfoReply) error { +func setSysInfoReply(sis *SysInfoReply) error { sis.SysARCH = runtime.GOARCH sis.SysOS = runtime.GOOS sis.SysCPUS = runtime.NumCPU() @@ -59,6 +59,6 @@ func setSysInfoReply(sis *GetSysInfoReply) error { } // Get method -func (s *GetSysInfoService) Get(r *http.Request, args *Args, reply *GetSysInfoReply) error { +func (s *SysInfoService) Get(r *http.Request, args *Args, reply *SysInfoReply) error { return setSysInfoReply(reply) }