backend.go 898 B

123456789101112131415161718192021
  1. package volume // import "github.com/docker/docker/api/server/router/volume"
  2. import (
  3. "context"
  4. "github.com/docker/docker/volume/service/opts"
  5. // TODO return types need to be refactored into pkg
  6. "github.com/docker/docker/api/types"
  7. "github.com/docker/docker/api/types/filters"
  8. "github.com/docker/docker/api/types/volume"
  9. )
  10. // Backend is the methods that need to be implemented to provide
  11. // volume specific functionality
  12. type Backend interface {
  13. List(ctx context.Context, filter filters.Args) ([]*volume.Volume, []string, error)
  14. Get(ctx context.Context, name string, opts ...opts.GetOption) (*volume.Volume, error)
  15. Create(ctx context.Context, name, driverName string, opts ...opts.CreateOption) (*volume.Volume, error)
  16. Remove(ctx context.Context, name string, opts ...opts.RemoveOption) error
  17. Prune(ctx context.Context, pruneFilters filters.Args) (*types.VolumesPruneReport, error)
  18. }