Documentation
¶
Index ¶
- Constants
- func BytesToGiB(volumeSizeBytes int64) int64
- func GetAccessModes(caps []*csi.VolumeCapability) *[]string
- func GiBToBytes(volumeSizeGiB int64) int64
- func ParseEndpoint(endpoint string) (string, string, error)
- func RoundUpBytes(volumeSizeBytes int64) int64
- func RoundUpGiB(volumeSizeBytes int64) int64
- type VolumeLocks
Constants ¶
View Source
const (
GiB = 1024 * 1024 * 1024
)
View Source
const (
VolumeOperationAlreadyExistsFmt = "An operation with the given volume key %s already exists"
)
Variables ¶
This section is empty.
Functions ¶
func GetAccessModes ¶
func GetAccessModes(caps []*csi.VolumeCapability) *[]string
GetAccessModes returns a slice containing all of the access modes defined in the passed in VolumeCapabilities.
func RoundUpBytes ¶
RoundUpBytes rounds up the volume size in bytes upto multiplications of GiB in the unit of Bytes
func RoundUpGiB ¶
RoundUpGiB rounds up the volume size in bytes upto multiplications of GiB in the unit of GiB
Types ¶
type VolumeLocks ¶
type VolumeLocks struct {
// contains filtered or unexported fields
}
VolumeLocks implements a map with atomic operations. It stores a set of all volume IDs with an ongoing operation.
func NewVolumeLocks ¶
func NewVolumeLocks() *VolumeLocks
func (*VolumeLocks) Release ¶
func (vl *VolumeLocks) Release(volumeID string)
func (*VolumeLocks) TryAcquire ¶
func (vl *VolumeLocks) TryAcquire(volumeID string) bool
TryAcquire tries to acquire the lock for operating on volumeID and returns true if successful. If another operation is already using volumeID, returns false.
Click to show internal directories.
Click to hide internal directories.