Documentation
¶
Index ¶
- Constants
- func BytesToGb(bytes int64) int64
- func CreateNodeID(project, zone, name string) string
- func CreateZonalVolumeID(project, zone, name string) string
- func GbToBytes(Gb int64) int64
- func GenerateUnderspecifiedVolumeID(diskName string, isZonal bool) string
- func GetDeviceName(volKey *meta.Key) (string, error)
- func GetRegionFromZones(zones []string) (string, error)
- func KeyToVolumeID(volKey *meta.Key, project string) (string, error)
- func NodeIDToZoneAndName(id string) (string, string, error)
- func SnapshotIDToKey(id string) (string, error)
- func VolumeIDToKey(id string) (*meta.Key, error)
- type VolumeLocks
Constants ¶
View Source
const ( // Keys for Storage Class Parameters ParameterKeyType = "type" ParameterKeyReplicationType = "replication-type" ParameterKeyDiskEncryptionKmsKey = "disk-encryption-kms-key" // Keys for Topology. This key will be shared amongst drivers from GCP TopologyKeyZone = "topology.gke.io/zone" // VolumeAttributes for Partition VolumeAttributePartition = "partition" UnspecifiedValue = "UNSPECIFIED" )
View Source
const (
VolumeOperationAlreadyExistsFmt = "An operation with the given Volume ID %s already exists"
)
Variables ¶
This section is empty.
Functions ¶
func CreateNodeID ¶
func CreateZonalVolumeID ¶ added in v0.6.0
func GetRegionFromZones ¶
func KeyToVolumeID ¶ added in v0.6.0
func SnapshotIDToKey ¶
Types ¶
type VolumeLocks ¶ added in v0.6.0
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 ¶ added in v0.6.0
func NewVolumeLocks() *VolumeLocks
func (*VolumeLocks) Release ¶ added in v0.6.0
func (vl *VolumeLocks) Release(volumeID string)
func (*VolumeLocks) TryAcquire ¶ added in v0.6.0
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.