Documentation ¶
Index ¶
- Constants
- func BytesToGiB(volumeSizeBytes int64) int64
- func ConvertTagsToMap(tags string) (map[string]string, error)
- func GetElementsInArray1NotInArray2(arr1 []int, arr2 []int) []int
- func GiBToBytes(volumeSizeGiB int64) int64
- func IsLinuxOS() bool
- func IsWindowsOS() bool
- func MakeDir(pathname string) error
- func MakeFile(pathname string) error
- func RoundUpBytes(volumeSizeBytes int64) int64
- func RoundUpGiB(volumeSizeBytes int64) int64
- func RoundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64
- type VolumeLocks
Constants ¶
const ( GiB = 1024 * 1024 * 1024 TagsDelimiter = "," TagKeyValueDelimiter = "=" )
Variables ¶
This section is empty.
Functions ¶
func ConvertTagsToMap ¶ added in v0.5.0
ConvertTagsToMap convert the tags from string to map the valid tags format is "key1=value1,key2=value2", which could be converted to {"key1": "value1", "key2": "value2"}
func GetElementsInArray1NotInArray2 ¶ added in v1.29.3
func IsLinuxOS ¶ added in v1.5.0
func IsLinuxOS() bool
IsLinuxOS decides whether the driver is running on linux OS.
func IsWindowsOS ¶ added in v1.5.0
func IsWindowsOS() bool
IsWindowsOS decides whether the driver is running on windows OS.
func RoundUpBytes ¶
RoundUpBytes rounds up the volume size in bytes up to multiplications of GiB in the unit of Bytes
func RoundUpGiB ¶
RoundUpGiB rounds up the volume size in bytes up to multiplications of GiB in the unit of GiB
func RoundUpSize ¶ added in v1.23.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)
Types ¶
type VolumeLocks ¶ added in v1.0.0
type VolumeLocks struct {
// contains filtered or unexported fields
}
func NewVolumeLocks ¶ added in v1.0.0
func NewVolumeLocks() *VolumeLocks
func (*VolumeLocks) Release ¶ added in v1.0.0
func (vl *VolumeLocks) Release(volumeID string)
func (*VolumeLocks) TryAcquire ¶ added in v1.0.0
func (vl *VolumeLocks) TryAcquire(volumeID string) bool