Documentation
¶
Index ¶
- Constants
- Variables
- func OptsFromMeta(ctxt context.Context, d DateraDriver, name string) (string, string, error)
- type DateraDriver
- func (d DateraDriver) Capabilities() *dv.CapabilitiesResponse
- func (d DateraDriver) Create(r *dv.CreateRequest) error
- func (d DateraDriver) Get(r *dv.GetRequest) (*dv.GetResponse, error)
- func (d DateraDriver) List() (*dv.ListResponse, error)
- func (d DateraDriver) Mount(r *dv.MountRequest) (*dv.MountResponse, error)
- func (d DateraDriver) MountPoint(name string) string
- func (d DateraDriver) Path(r *dv.PathRequest) (*dv.PathResponse, error)
- func (d DateraDriver) Remove(r *dv.RemoveRequest) error
- func (d DateraDriver) Unmount(r *dv.UnmountRequest) error
- type IClient
Constants ¶
View Source
const ( DefaultSize = 16 DefaultFS = "ext4" DefaultReplicas = 3 DefaultPlacement = "hybrid" DefaultPersistence = "manual" DriverVersion = "2.0.3" DRIVER = "Docker-Volume" // Volume Options OptSize = "size" OptReplica = "replica" OptTemplate = "template" OptFstype = "fsType" OptMaxiops = "maxIops" OptMaxbw = "maxBW" OptPlacement = "placementMode" OptPersistence = "persistenceMode" OptCloneSrc = "cloneSrc" // V2 Volume Plugin static mounts must be under /mnt MountLoc = "/mnt" // Misc DeleteConst = "auto" )
Variables ¶
View Source
var Opts = map[string][]string{ OptSize: []string{"Volume Size In GiB", strconv.Itoa(DefaultSize)}, OptReplica: []string{"Volume Replicas", strconv.Itoa(DefaultReplicas)}, OptTemplate: []string{"Volume Template", "None"}, OptFstype: []string{"Volume Filesystem", DefaultFS}, OptMaxiops: []string{"Volume Max Total IOPS", "0"}, OptMaxbw: []string{"Volume Max Total Bandwidth", "0"}, OptPlacement: []string{"Volume Placement", DefaultPlacement}, OptPersistence: []string{"Volume Persistence", DefaultPersistence}, OptCloneSrc: []string{"Volume Source For Clone", "None"}, }
Functions ¶
func OptsFromMeta ¶
Types ¶
type DateraDriver ¶
type DateraDriver struct { DateraClient IClient Mutex *sync.Mutex Version string Debug *bool Ssl bool Conf *dc.Config }
func NewDateraDriver ¶
func NewDateraDriver(conf *dc.Config) DateraDriver
func (DateraDriver) Capabilities ¶
func (d DateraDriver) Capabilities() *dv.CapabilitiesResponse
func (DateraDriver) Create ¶
func (d DateraDriver) Create(r *dv.CreateRequest) error
Create creates a volume on the configured Datera backend
Specified using `--opt key=value` in the docker volume create command
Available Options:
size replica -- Default: 3 template fsType -- Default: ext4 maxIops maxBW placementMode -- Default: hybrid persistenceMode -- Default: manual cloneSrc
func (DateraDriver) Get ¶
func (d DateraDriver) Get(r *dv.GetRequest) (*dv.GetResponse, error)
func (DateraDriver) List ¶
func (d DateraDriver) List() (*dv.ListResponse, error)
func (DateraDriver) Mount ¶
func (d DateraDriver) Mount(r *dv.MountRequest) (*dv.MountResponse, error)
func (DateraDriver) MountPoint ¶
func (d DateraDriver) MountPoint(name string) string
func (DateraDriver) Path ¶
func (d DateraDriver) Path(r *dv.PathRequest) (*dv.PathResponse, error)
func (DateraDriver) Remove ¶
func (d DateraDriver) Remove(r *dv.RemoveRequest) error
func (DateraDriver) Unmount ¶
func (d DateraDriver) Unmount(r *dv.UnmountRequest) error
type IClient ¶
type IClient interface { GetVolume(context.Context, string) (*dsdk.AppInstance, error) CreateVolume(context.Context, string, *dc.VolOpts) error DeleteVolume(context.Context, string, string) error LoginVolume(context.Context, string, string) (string, error) MountVolume(context.Context, string, string, string, string) error UnmountVolume(context.Context, string, string) error DetachVolume(context.Context, string) error GetIQNandPortals(context.Context, string) (string, []string, string, error) FindDeviceFsType(context.Context, string) (string, error) ListVolumes(context.Context) ([]string, error) GetMetadata(context.Context, string) (*map[string]interface{}, error) PutMetadata(context.Context, string, *map[string]interface{}) error }
Need to require interface instead of DateraClient directly so we can mock DateraClient out more easily
Click to show internal directories.
Click to hide internal directories.