Documentation ¶
Index ¶
Constants ¶
const ( OPT_MOUNT_POINT = "MountPoint" OPT_SIZE = "Size" OPT_FORMAT = "Format" OPT_VOLUME_NAME = "VolumeName" OPT_VOLUME_DRIVER_ID = "VolumeDriverID" OPT_VOLUME_TYPE = "VolumeType" OPT_VOLUME_IOPS = "VolumeIOPS" OPT_VOLUME_CREATED_TIME = "VolumeCreatedAt" OPT_SNAPSHOT_NAME = "SnapshotName" OPT_SNAPSHOT_CREATED_TIME = "SnapshotCreatedAt" OPT_BACKUP_URL = "BackupURL" OPT_ENDPOINT_URL = "EndpointURL" OPT_REFERENCE_ONLY = "ReferenceOnly" OPT_PREPARE_FOR_VM = "PrepareForVM" OPT_FILESYSTEM = "Filesystem" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BackupOperations ¶
type BackupOperations interface { Name() string CreateBackup(snapshotID, volumeID, destURL, endpointURL string, opts map[string]string) (string, error) DeleteBackup(backupURL, endpointURL string) error GetBackupInfo(backupURL, endpointURL string) (map[string]string, error) ListBackup(destURL, endpointURL string, opts map[string]string) (map[string]map[string]string, error) }
BackupOperations is Convoy Driver backup related operations interface. Any Convoy Driver want to provide backup functionality must implement this interface. Restore would need to be implemented in VolumeOperations.CreateVolume() with opts[OPT_BACKUP_URL]
type ConvoyDriver ¶
type ConvoyDriver interface { Name() string Info() (map[string]string, error) VolumeOps() (VolumeOperations, error) SnapshotOps() (SnapshotOperations, error) BackupOps() (BackupOperations, error) }
ConvoyDriver interface would provide all the functionality needed for driver specific handling. Driver can choose to implement some or all of the available operations interfaces to provide different functionality to Convoy user. xxxOps() should return error if the functionality is not implemented by the driver.
type InitFunc ¶
type InitFunc func(root string, config map[string]string) (ConvoyDriver, error)
InitFunc is the initialize function for each ConvoyDriver. Each driver must implement this function and register itself through Register().
The registered function would be called upon Convoy need a ConvoyDriver instance, and it would return a valid ConvoyDriver for operation.
The registered function would take a "root" path, used as driver's configuration file path, and a map of configuration specified for the driver.
type SnapshotOperations ¶
type SnapshotOperations interface { Name() string CreateSnapshot(req Request) error DeleteSnapshot(req Request) error GetSnapshotInfo(req Request) (map[string]string, error) ListSnapshot(opts map[string]string) (map[string]map[string]string, error) }
SnapshotOperations is Convoy Driver snapshot related operations interface. Any Convoy Driver want to operate snapshots must implement this interface.
type VolumeOperations ¶
type VolumeOperations interface { Name() string CreateVolume(req Request) error DeleteVolume(req Request) error MountVolume(req Request) (string, error) UmountVolume(req Request) error MountPoint(req Request) (string, error) GetVolumeInfo(name string) (map[string]string, error) ListVolume(opts map[string]string) (map[string]map[string]string, error) }
VolumeOperations is Convoy Driver volume related operations interface. Any Convoy Driver must implement this interface.