Documentation
¶
Index ¶
- Constants
- func ConvertSize(sizeToConvert, unitToConvertTo string) (int, error)
- func ConvertToGB(size, unit string) (int, error)
- func ConvertToMB(size, unit string) (int, error)
- func GetPropertiesKVSet(i interface{}) map[string]interface{}
- func ReadPublicKey(path string) (key string, err error)
- func ValidateIPv6CidrBlockAgainstParentCidrBlock(cidr string, expectedMask int, parentCidr string) error
Constants ¶
View Source
const ( MegaBytes = "MB" GigaBytes = "GB" TerraBytes = "TB" PetaBytes = "PB" )
Variables ¶
This section is empty.
Functions ¶
func ConvertSize ¶
ConvertSize converts the specified size to the unit specified Right now, it has support for MB, GB
func ConvertToGB ¶
func ConvertToMB ¶
func GetPropertiesKVSet ¶
func GetPropertiesKVSet(i interface{}) map[string]interface{}
GetPropertiesKVSet converts a struct to a map[string]interface{}. It will only include fields that are set and are not nil. It will also recursively convert any nested structs.
type MyStruct struct { Field1 int Field2 string } instance := MyStruct{Field1: 42, Field2: "Hello"} result := GetPropertiesKVSet(instance) // map[string]interface{}{"Field1": 42, "Field2": "Hello"}
func ReadPublicKey ¶
ReadPublicKey from a specific path
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.