Rename stuttered service names and make them appropriate

master
Harshavardhana 9 years ago
parent 18a8891a15
commit a3ccb9d405
  1. 6
      pkg/server/router.go
  2. 12
      pkg/server/rpc/diskinfo.go
  3. 12
      pkg/server/rpc/sysinfo.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)
}

@ -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)
}

@ -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)
}

Loading…
Cancel
Save