Documentation ¶
Index ¶
- Constants
- func Int(i *int) int
- func Int32(i *int32) int32
- func Int32Ptr(i int32) *int32
- func Int64(i *int64) int64
- func IntPtr(i int) *int
- func KeyValueToMap(kv []*KeyValue) map[string]string
- func MapToString(m map[string]string, entrySep string, kvSep string, keyPrefix string) string
- func SanitizeTags(tags map[string]string) map[string]string
- func SizeInGi(sizeInBytes int64) int64
- func SliceStringPtr(s []string) []*string
- func StringFromPtr(s *string) string
- func StringMap(msp map[string]*string) map[string]string
- func StringMapPtr(ms map[string]string) *map[string]*string
- func StringPtr(s string) *string
- func StringSlice(s *[]string) []string
- type KeyValue
- type Provider
- type RestoreTargeter
- type Snapshot
- type SnapshotTags
- type TimeStamp
- type Type
- type Volume
- type VolumeTags
Constants ¶
const ( GoogleCloudZone = "CLOUDSDK_COMPUTE_ZONE" GoogleCloudCreds = "GOOGLE_APPLICATION_CREDENTIALS" GoogleProjectID = "projectID" GoogleServiceKey = "serviceKey" AzureStorageAccount = "AZURE_STORAGE_ACCOUNT_NAME" AzureStorageKey = "AZURE_STORAGE_ACCOUNT_KEY" AzureSubscriptionID = "AZURE_SUBSCRIPTION_ID" AzureTenantID = "AZURE_TENANT_ID" AzureClientID = "AZURE_CLIENT_ID" AzureClientSecret = "AZURE_CLIENT_SECRET" AzureResurceGroup = "AZURE_RESOURCE_GROUP" AzureResurceMgrEndpoint = "AZURE_RESOURCE_MANAGER_ENDPOINT" AzureMigrateStorageAccount = "AZURE_MIGRATE_STORAGE_ACCOUNT_NAME" AzureMigrateStorageKey = "AZURE_MIGRATE_STORAGE_ACCOUNT_KEY" AzureMigrateResourceGroup = "AZURE_MIGRATE_RESOURCE_GROUP" AzureActiveDirEndpoint = "AZURE_AD_ENDPOINT" AzureActiveDirResourceID = "AZURE_AD_RESOURCE" AzureCloudEnvironmentID = "AZURE_CLOUD_ENV_ID" )
Google Cloud environment variable names
const ( BytesInGi = 1024 * 1024 * 1024 BytesInMi = 1024 * 1024 )
const SnapshotDoesNotExistError = "Snapshot does not exist"
Variables ¶
This section is empty.
Functions ¶
func Int32 ¶
Int32 returns an int value for the passed int pointer. It returns 0 if the pointer is nil.
func Int64 ¶
Int64 returns an int value for the passed int pointer. It returns 0 if the pointer is nil.
func KeyValueToMap ¶
KeyValueToMap converts a KeyValue slice to a map
func MapToString ¶
MapToString creates a string representation of a map with the entries separated by entrySep, and the key separated from the value using kvSep
func SanitizeTags ¶
SanitizeTags are used to sanitize the tags
func SliceStringPtr ¶
SliceStringPtr returns a slice of string pointers from the passed string slice.
func StringFromPtr ¶
StringFromPtr returns a string value for the passed string pointer. It returns the empty string if the pointer is nil.
func StringMap ¶
StringMap returns a map of strings built from the map of string pointers. The empty string is used for nil pointers.
func StringMapPtr ¶
StringMapPtr returns a pointer to a map of string pointers built from the passed map of strings.
func StringSlice ¶
StringSlice returns a string slice value for the passed string slice pointer. It returns a nil slice if the pointer is nil.
Types ¶
type KeyValue ¶
KeyValue String key-value pairs
func MapToKeyValue ¶
MapToKeyValue converts a map to a KeyValue slice
type Provider ¶
type Provider interface { // Type returns the underlying storage type Type() Type // Volume operations VolumeCreate(context.Context, Volume) (*Volume, error) VolumeCreateFromSnapshot(ctx context.Context, snapshot Snapshot, tags map[string]string) (*Volume, error) VolumeDelete(context.Context, *Volume) error VolumeGet(ctx context.Context, id string, zone string) (*Volume, error) // Snapshot operations SnapshotCopy(ctx context.Context, from Snapshot, to Snapshot) (*Snapshot, error) // SnapshotCopyWithArgs func is invoked to perform migration when there is a need to provide // additional params such as creds of target cluster to carry out the // Snapshot copy action, use SnapshotCopy func otherwise. // Currently used by Azure only. SnapshotCopyWithArgs(ctx context.Context, from Snapshot, to Snapshot, args map[string]string) (*Snapshot, error) SnapshotCreate(ctx context.Context, volume Volume, tags map[string]string) (*Snapshot, error) SnapshotCreateWaitForCompletion(context.Context, *Snapshot) error SnapshotDelete(context.Context, *Snapshot) error SnapshotGet(ctx context.Context, id string) (*Snapshot, error) // Others SetTags(ctx context.Context, resource interface{}, tags map[string]string) error VolumesList(ctx context.Context, tags map[string]string, zone string) ([]*Volume, error) SnapshotsList(ctx context.Context, tags map[string]string) ([]*Snapshot, error) }
Provider abstracts actions on underlying storage
type RestoreTargeter ¶
type RestoreTargeter interface { // SnapshotRestoreTargets returns whether a snapshot can be restored globally. // If not globally restorable, returns a map of the regions and zones to which snapshot can be restored. SnapshotRestoreTargets(context.Context, *Snapshot) (global bool, regionsAndZones map[string][]string, err error) }
RestoreTargeter implements the SnapshotRestoreTargets method
type Snapshot ¶
type Snapshot struct { // Time stamp when snapshot creation was initiated CreationTime TimeStamp // Snapshot is encrypted Encrypted bool // A unique identifier generated by the storage provider ID string // Snapshot availability region Region string // The size of the snapshot, in Bytes SizeInBytes int64 // tags Tags SnapshotTags // Storage type of the source volume for this snapshot Type Type // volume Volume *Volume // ProvisioningState is snapshot's provisioning state. ProvisioningState string }
Snapshot of Volume
type TimeStamp ¶
TimeStamp Time stamp for an event related to an object, for example when the object was created.
type Type ¶
type Type string
Type is the type of storage supported
const ( // TypeAD captures enum value "AD" TypeAD Type = "AD" // TypeEBS captures enum value "EBS" TypeEBS Type = "EBS" // TypeGPD captures enum value "GPD" TypeGPD Type = "GPD" // TypeCinder captures enum value "Cinder" TypeCinder Type = "Cinder" // TypeGeneric captures enum value "Generic" TypeGeneric Type = "Generic" // TypeCeph captures enum value "Ceph" TypeCeph Type = "Ceph" // TypeEFS captures enum value "EFS" TypeEFS Type = "EFS" // TypeFCD capture enum value for "VMWare FCD" TypeFCD Type = "FCD" )
type Volume ¶
type Volume struct { // Availability zone Az string // Time stamp when volume creation was initiated CreationTime TimeStamp // Volume is encrypted Encrypted bool // A unique identifier generated by the storage provider ID string // Volume IOPS, if specified for this volume Iops int64 // The size of the volume, in Bytes SizeInBytes int64 // tags Tags VolumeTags // Storage type for this volume Type Type // Volume type VolumeType string // Attributes specific to the provider Attributes map[string]string }
Volume A storage provider volume