Documentation
¶
Index ¶
- Constants
- func Average(xs []float64) float64
- func BytesToBits(b float64) float64
- func BytesToGibiBytes(b float64) float64
- func BytesToMebiBytes(b float64) float64
- func BytesToMegaBytes(b float64) float64
- func CommonBase(strings ...string) string
- func KibiBytesToMebiBytes(b float64) float64
- func ParseZfsSize(size string) (float64, error)
- func RoundNDecimals[T Float](n int) func(T) T
- func RoundTwoDecimals[T Float](n T) T
- func SizeConvertionFunction(fromUnitLabel string, toUnitLabel string) func(float64) float64
- type Float
- type IndexedValue
- type MapWithDefault
- type UnitPrefix
Constants ¶
View Source
const ( BIT = "b" BYTE = "B" KILO = "K" MEGA = "M" GIGA = "G" TERA = "T" PETA = "P" EXA = "E" ZETTA = "Z" YOTTA = "Y" RONNA = "R" QUETTA = "Q" KIBI = "Ki" MEBI = "Mi" GIBI = "Gi" TEBI = "Ti" EXBI = "Ei" PEBI = "Pi" ZEBI = "Zi" YOBI = "Yi" ROBI = "Ri" QUEBI = "Qi" )
View Source
const BINARY_KILO = 1024
View Source
const DECIMAL_KILO = 1000
Variables ¶
This section is empty.
Functions ¶
func BytesToBits ¶
func BytesToGibiBytes ¶
func BytesToMebiBytes ¶
func BytesToMegaBytes ¶
func CommonBase ¶ added in v0.3.8
func KibiBytesToMebiBytes ¶ added in v0.2.2
func ParseZfsSize ¶ added in v0.3.0
func RoundNDecimals ¶ added in v0.4.0
func RoundTwoDecimals ¶
func RoundTwoDecimals[T Float](n T) T
Types ¶
type IndexedValue ¶ added in v0.2.2
type MapWithDefault ¶ added in v0.4.0
type MapWithDefault[K comparable, V any] struct { // contains filtered or unexported fields }
func NewMapWithDefault ¶ added in v0.4.0
func NewMapWithDefault[K comparable, V any](internalMap map[K]V, defaultValue V) MapWithDefault[K, V]
func (MapWithDefault[K, V]) Get ¶ added in v0.4.0
func (mwd MapWithDefault[K, V]) Get(key K) V
type UnitPrefix ¶ added in v0.4.0
type UnitPrefix struct {
// contains filtered or unexported fields
}
func NewUnitPrefix ¶ added in v0.4.0
func NewUnitPrefix(label string, exponent int) UnitPrefix
Click to show internal directories.
Click to hide internal directories.