api.go 899 B

12345678910111213141516171819202122232425
  1. //go:generate pluginrpc-gen -i $GOFILE -o proxy.go -type VolumeDriver -name VolumeDriver
  2. package volumedrivers
  3. import "github.com/docker/docker/volume"
  4. // NewVolumeDriver returns a driver has the given name mapped on the given client.
  5. func NewVolumeDriver(name string, c client) volume.Driver {
  6. proxy := &volumeDriverProxy{c}
  7. return &volumeDriverAdapter{name, proxy}
  8. }
  9. // VolumeDriver defines the available functions that volume plugins must implement.
  10. type VolumeDriver interface {
  11. // Create a volume with the given name
  12. Create(name string) (err error)
  13. // Remove the volume with the given name
  14. Remove(name string) (err error)
  15. // Get the mountpoint of the given volume
  16. Path(name string) (mountpoint string, err error)
  17. // Mount the given volume and return the mountpoint
  18. Mount(name string) (mountpoint string, err error)
  19. // Unmount the given volume
  20. Unmount(name string) (err error)
  21. }