Documentation
¶
Index ¶
- type Driver
- func (d *Driver) Capabilities() *volume.CapabilitiesResponse
- func (d *Driver) Create(r *volume.CreateRequest) error
- func (d *Driver) Get(r *volume.GetRequest) (*volume.GetResponse, error)
- func (d *Driver) GetLock() *sync.RWMutex
- func (d *Driver) GetMounts() map[string]driver.Mount
- func (d *Driver) GetVolumes() map[string]driver.Volume
- func (d *Driver) List() (*volume.ListResponse, error)
- func (d *Driver) Mount(r *volume.MountRequest) (*volume.MountResponse, error)
- func (d *Driver) Path(r *volume.PathRequest) (*volume.PathResponse, error)
- func (d *Driver) Remove(r *volume.RemoveRequest) error
- func (d *Driver) RemoveMount(id string) error
- func (d *Driver) RemoveVolume(id string) error
- func (d *Driver) RunCmd(cmd string) error
- func (d *Driver) SaveConfig() error
- func (d *Driver) Unmount(r *volume.UnmountRequest) error
- type DriverConfig
- type DriverEventHandler
- type Mountpoint
- type Persistence
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct { Lock sync.RWMutex Persistence *viper.Viper Volumes map[string]*Volume Mounts map[string]*Mountpoint Config *DriverConfig EventHandler *DriverEventHandler }
Driver the global driver responding to call
func Init ¶
func Init(config *DriverConfig, eventHandler *DriverEventHandler) *Driver
Init load configuration and serve response to API call
func (*Driver) Capabilities ¶
func (d *Driver) Capabilities() *volume.CapabilitiesResponse
Capabilities Send capabilities of the local driver
func (*Driver) Create ¶
func (d *Driver) Create(r *volume.CreateRequest) error
Create create and init the requested volume
func (*Driver) Get ¶
func (d *Driver) Get(r *volume.GetRequest) (*volume.GetResponse, error)
Get get info on the requested volume
func (*Driver) GetVolumes ¶
GetVolumes list volumes of driver
func (*Driver) List ¶
func (d *Driver) List() (*volume.ListResponse, error)
List Volumes handled by these driver
func (*Driver) Mount ¶
func (d *Driver) Mount(r *volume.MountRequest) (*volume.MountResponse, error)
Mount mount the requested volume
func (*Driver) Path ¶
func (d *Driver) Path(r *volume.PathRequest) (*volume.PathResponse, error)
Path get path of the requested volume
func (*Driver) Remove ¶
func (d *Driver) Remove(r *volume.RemoveRequest) error
Remove remove the requested volume
func (*Driver) RemoveMount ¶
RemoveMount remove a mount of driver
func (*Driver) RemoveVolume ¶
RemoveVolume remove a volume of driver
func (*Driver) SaveConfig ¶
SaveConfig stroe config/state in file
type DriverConfig ¶
type DriverConfig struct { Version int Root string Folder string CustomOptions map[string]interface{} }
DriverConfig contains configration of driver
type DriverEventHandler ¶
type DriverEventHandler struct { OnInit func(*Driver) error OnMountVolume func(*Driver, driver.Volume, driver.Mount, *volume.MountRequest) (*volume.MountResponse, error) GetMountName func(d *Driver, r *volume.CreateRequest) (string, error) }
DriverEventHandler contains function to execute on event
type Mountpoint ¶
Mountpoint represent a docker volume mountpoint
func (*Mountpoint) GetConnections ¶
func (d *Mountpoint) GetConnections() int
GetConnections get number of connection on mount
func (*Mountpoint) SetConnections ¶
func (d *Mountpoint) SetConnections(n int)
SetConnections set number of connection on mount
type Persistence ¶
type Persistence struct { Version int `json:"version"` Volumes map[string]*Volume `json:"volumes"` Mounts map[string]*Mountpoint `json:"mounts"` }
Persistence represent struct of Persistence file
type Volume ¶
type Volume struct { Options map[string]string `json:"options"` Mount string `json:"mount"` Connections int `json:"connections"` }
Volume represent a docker volume
func (*Volume) GetConnections ¶
GetConnections get number of connection on volume
func (*Volume) GetOptions ¶
GetOptions get options definition of volume
func (*Volume) SetConnections ¶
SetConnections set number of connection on volume