Merge pull request #704 from harshavardhana/pr_out_rename_stuttered_service_names_and_make_them_appropriate

This commit is contained in:
Harshavardhana 2015-07-05 17:23:22 +00:00
commit 75a32d1c01
3 changed files with 15 additions and 15 deletions

View File

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

View File

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

View File

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