Documentation ¶
Index ¶
Constants ¶
View Source
const ( // KiloByte represent 1024 bytes KiloByte = (1 << 10) // MegaByte represent 1024 kilobytes MegaByte = (KiloByte << 10) // GigaByte represent 1024 megabytes GigaByte = (MegaByte << 10) // TeraByte represent 1024 gigabytes TeraByte = (GigaByte << 10) )
Variables ¶
View Source
var ( //MemUsage represents the memory capacity of the node MemUsage map[Capacity]int64 //CPUUsage represents the CPU capacity of the node CPUUsage map[Capacity]int64 //NetUsage represents the networking capacity of the node NetUsage map[Capacity]int64 //Usage represent all capacities of the host node Usage = map[string]map[Capacity]int64{ "memory": MemUsage, "cpu": CPUUsage, "network": NetUsage, } )
Functions ¶
This section is empty.
Types ¶
type Capacity ¶
type Capacity int
Capacity represents the amout of available ressources
func GetCPUCapacity ¶
GetCPUCapacity returns the corresponding CPU Capacity
func GetMemoryCapacity ¶
GetMemoryCapacity returns a Capacty for the system memory
type NetworkType ¶
type NetworkType int
NetworkType represents the network type of the system : internal or external
const ( //NetworkExternal represent a node with outside network access NetworkExternal NetworkType = iota //NetworkInternal represent a node with insider network access (on the target LAN) NetworkInternal )
func (NetworkType) String ¶
func (t NetworkType) String() string
String will expand the network type to it's human readable value
type Requirements ¶
type Requirements struct { NetworkType NetworkType `json:"network_type"` // "external", "internal", "" NetworkCapacity Capacity `json:"network_capacity"` // CapacityLow, CapacityMedium, CapacityHigh ComputingCapacity Capacity `json:"computing_capacity"` // CapacityLow, CapacityMedium, CapacityHigh MemoryCapacity Capacity `json:"memory_capacity"` // CapacityLow, CapacityMedium, CapacityHigh }
Requirements defines all the specification needed for a node to be eligble at executing commands.
func (Requirements) MarshalJSON ¶
func (r Requirements) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.