Documentation ¶
Index ¶
- Constants
- func Contains(list []string, strToSearch string) bool
- func RoundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64
- func RoundUpSizeInt(volumeSizeBytes int64, allocationUnitBytes int64) (int, error)
- func RoundUpToGiBInt(size resource.Quantity) (int, error)
- func StringListEqual(list1, list2 []string) bool
Constants ¶
const (
GIB = 1024 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func Contains ¶ added in v1.18.0
Contains searches if a string list contains the given string or not.
func RoundUpSize ¶ added in v1.19.0
RoundUpSize calculates how many allocation units are needed to accommodate a volume of given size. E.g. when user wants 1500MiB volume, while AWS EBS allocates volumes in gibibyte-sized chunks, RoundUpSize(1500 * 1024*1024, 1024*1024*1024) returns '2' (2 GiB is the smallest allocatable volume that can hold 1500MiB)
func RoundUpSizeInt ¶ added in v1.19.0
RoundUpSizeInt calculates how many allocation units are needed to accommodate a volume of given size. It returns an int instead of an int64 and an error if there's overflow
func RoundUpToGiBInt ¶ added in v1.19.0
RoundUpToGiBInt rounds up given quantity upto chunks of GiB. It returns an int instead of an int64 and an error if there's overflow
func StringListEqual ¶
StringListEqual compares two string list, returns true if they have the same items, order doesn't matter
Types ¶
This section is empty.