2015-06-10 09:46:54 -04:00
|
|
|
//go:generate pluginrpc-gen -i $GOFILE -o proxy.go -type VolumeDriver -name VolumeDriver
|
|
|
|
|
2015-05-19 16:05:25 -04:00
|
|
|
package volumedrivers
|
|
|
|
|
|
|
|
import "github.com/docker/docker/volume"
|
|
|
|
|
2015-07-21 13:50:10 -04:00
|
|
|
// NewVolumeDriver returns a driver has the given name mapped on the given client.
|
2015-05-19 16:05:25 -04:00
|
|
|
func NewVolumeDriver(name string, c client) volume.Driver {
|
|
|
|
proxy := &volumeDriverProxy{c}
|
|
|
|
return &volumeDriverAdapter{name, proxy}
|
|
|
|
}
|
|
|
|
|
2015-07-21 13:50:10 -04:00
|
|
|
// VolumeDriver defines the available functions that volume plugins must implement.
|
2015-05-19 16:05:25 -04:00
|
|
|
type VolumeDriver interface {
|
2015-06-10 09:46:54 -04:00
|
|
|
// Create a volume with the given name
|
2015-05-19 16:05:25 -04:00
|
|
|
Create(name string) (err error)
|
2015-06-10 09:46:54 -04:00
|
|
|
// Remove the volume with the given name
|
2015-05-19 16:05:25 -04:00
|
|
|
Remove(name string) (err error)
|
2015-06-10 09:46:54 -04:00
|
|
|
// Get the mountpoint of the given volume
|
2015-05-19 16:05:25 -04:00
|
|
|
Path(name string) (mountpoint string, err error)
|
2015-06-10 09:46:54 -04:00
|
|
|
// Mount the given volume and return the mountpoint
|
2015-05-19 16:05:25 -04:00
|
|
|
Mount(name string) (mountpoint string, err error)
|
2015-06-10 09:46:54 -04:00
|
|
|
// Unmount the given volume
|
2015-05-19 16:05:25 -04:00
|
|
|
Unmount(name string) (err error)
|
|
|
|
}
|