Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseQuantityString ¶
ParseQuantityString is a fast scanner for quantity values. this parsing is only for cpu and mem resources
Types ¶
type CPUUnitStr ¶
type CPUUnitStr string
const ( CORE CPUUnitStr = "Core" MILLI CPUUnitStr = "m" )
func (CPUUnitStr) GetCPUUnit ¶
func (cpuUnitStr CPUUnitStr) GetCPUUnit() UnitSuffix
type MemoryUnitStr ¶
type MemoryUnitStr string
const ( MILLIBYTE MemoryUnitStr = "m" BYTE MemoryUnitStr = "byte" KIBYTE MemoryUnitStr = "Ki" MIBYTE MemoryUnitStr = "Mi" GIBYTE MemoryUnitStr = "Gi" TIBYTE MemoryUnitStr = "Ti" PIBYTE MemoryUnitStr = "Pi" EIBYTE MemoryUnitStr = "Ei" KBYTE MemoryUnitStr = "k" MBYTE MemoryUnitStr = "M" GBYTE MemoryUnitStr = "G" TBYTE MemoryUnitStr = "T" PBYTE MemoryUnitStr = "P" EBYTE MemoryUnitStr = "E" )
func (MemoryUnitStr) GetMemoryUnit ¶
func (memoryUnitStr MemoryUnitStr) GetMemoryUnit() UnitSuffix
type TimeUnitStr ¶
type TimeUnitStr string
const ( SecondStr TimeUnitStr = "Seconds" MinuteStr TimeUnitStr = "Minutes" HourStr TimeUnitStr = "Hours" )
func (TimeUnitStr) GetTimeUnit ¶
func (timeUnitStr TimeUnitStr) GetTimeUnit() UnitSuffix
type Unit ¶
type Unit struct { // Name is unit name Name string `json:"name"` // ConversionFactor is used to convert this unit to the base unit // if ConversionFactor is 1, then this is the base unit ConversionFactor float64 `json:"conversionFactor"` }
Unit represents unit of a configuration
type UnitStr ¶
type UnitStr interface { CPUUnitStr | MemoryUnitStr | TimeUnitStr }
type UnitSuffix ¶
type UnitSuffix int
const ( Byte UnitSuffix = 1 KiByte UnitSuffix = 2 // 1024 MiByte UnitSuffix = 3 GiByte UnitSuffix = 4 TiByte UnitSuffix = 5 PiByte UnitSuffix = 6 EiByte UnitSuffix = 7 K UnitSuffix = 8 // 1000 M UnitSuffix = 9 G UnitSuffix = 10 T UnitSuffix = 11 P UnitSuffix = 12 E UnitSuffix = 13 Core UnitSuffix = 14 // CPU cores Milli UnitSuffix = 15 Second UnitSuffix = 16 Minute UnitSuffix = 17 Hour UnitSuffix = 18 MilliByte UnitSuffix = 19 )
func (UnitSuffix) GetCPUUnitStr ¶
func (cpuUnit UnitSuffix) GetCPUUnitStr() CPUUnitStr
func (UnitSuffix) GetMemoryUnitStr ¶
func (memoryUnit UnitSuffix) GetMemoryUnitStr() MemoryUnitStr
func (UnitSuffix) GetTimeUnitStr ¶
func (timeUnit UnitSuffix) GetTimeUnitStr() TimeUnitStr
type Units ¶
type Units struct {
// contains filtered or unexported fields
}
func (*Units) GetCpuUnits ¶
func (u *Units) GetCpuUnits() map[CPUUnitStr]Unit
func (*Units) GetMemoryUnits ¶
func (u *Units) GetMemoryUnits() map[MemoryUnitStr]Unit
func (*Units) GetTimeUnits ¶
func (u *Units) GetTimeUnits() map[TimeUnitStr]Unit
Click to show internal directories.
Click to hide internal directories.