backend.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package system // import "github.com/docker/docker/api/server/router/system"
  2. import (
  3. "context"
  4. "time"
  5. "github.com/docker/docker/api/types"
  6. "github.com/docker/docker/api/types/events"
  7. "github.com/docker/docker/api/types/filters"
  8. "github.com/docker/docker/api/types/swarm"
  9. )
  10. // DiskUsageOptions holds parameters for system disk usage query.
  11. type DiskUsageOptions struct {
  12. // Containers controls whether container disk usage should be computed.
  13. Containers bool
  14. // Images controls whether image disk usage should be computed.
  15. Images bool
  16. // Volumes controls whether volume disk usage should be computed.
  17. Volumes bool
  18. }
  19. // Backend is the methods that need to be implemented to provide
  20. // system specific functionality.
  21. type Backend interface {
  22. SystemInfo() *types.Info
  23. SystemVersion() types.Version
  24. SystemDiskUsage(ctx context.Context, opts DiskUsageOptions) (*types.DiskUsage, error)
  25. SubscribeToEvents(since, until time.Time, ef filters.Args) ([]events.Message, chan interface{})
  26. UnsubscribeFromEvents(chan interface{})
  27. AuthenticateToRegistry(ctx context.Context, authConfig *types.AuthConfig) (string, string, error)
  28. }
  29. // ClusterBackend is all the methods that need to be implemented
  30. // to provide cluster system specific functionality.
  31. type ClusterBackend interface {
  32. Info() swarm.Info
  33. }