Improve code further - this time further simplification of names

This commit is contained in:
Harshavardhana
2015-09-19 20:52:57 -07:00
parent 2721bef8da
commit 674631f9d8
15 changed files with 221 additions and 304 deletions
+32 -24
View File
@@ -16,65 +16,73 @@
package main
// Ethernet interface
type Ifc struct {
IP string `json:"ip"`
Mask string `json:"mask"`
Eth string `json:"ifc"`
// Network properties of a server
type Network struct {
IP string `json:"address"`
Mask string `json:"netmask"`
Ethernet string `json:"networkInterface"`
}
// Identify a server
// ServerArg server metadata to identify a server
type ServerArg struct {
Name string `json:"name"`
IP string `json:"ip"`
URL string `json:"url"`
ID string `json:"id"`
}
// Needed for Reply for Server.List
// ServerRep server reply container for Server.List
type ServerRep struct {
Name string `json:"name"`
IP string `json:"ip"`
ID string `json:"id"`
Name string `json:"name"`
Address string `json:"address"`
ID string `json:"id"`
}
// Default reply
// DefaultRep default reply
type DefaultRep struct {
Error int64 `json:"error"`
Message string `json:"message"`
}
// Needed for Reply List
// ServerListRep collection of server replies
type ServerListRep struct {
List []ServerRep
}
// Reply DiskStats
// DiskStatsRep collection of disks
type DiskStatsRep struct {
Disks []string
}
// Reply MemStats
// MemStatsRep memory statistics of a server
type MemStatsRep struct {
Total uint64 `json:"total"`
Free uint64 `json:"free"`
}
// Reply NetStats
// NetStatsRep network statistics of a server
type NetStatsRep struct {
Interfaces []Ifc
Interfaces []Network
}
// Reply SysInfo
// SysInfoRep system information of a server
type SysInfoRep struct {
Hostname string `json:"hostname"`
SysARCH string `json:"sys.arch"`
SysOS string `json:"sys.os"`
SysCPUS int `json:"sys.ncpus"`
Routines int `json:"goroutines"`
GOVersion string `json:"goversion"`
SysARCH string `json:"sysArch"`
SysOS string `json:"sysOS"`
SysCPUS int `json:"sysNcpus"`
Routines int `json:"goRoutines"`
GOVersion string `json:"goVersion"`
}
// Reply List
// ListRep all servers list
type ListRep struct {
List []ServerArg `json:"list"`
}
// VersionRep version reply
type VersionRep struct {
Version string `json:"version"`
BuildDate string `json:"buildDate"`
Architecture string `json:"arch"`
OperatingSystem string `json:"os"`
}