github.com/rumpl/bof@v23.0.0-rc.2+incompatible/api/server/router/system/backend.go (about) 1 package system // import "github.com/docker/docker/api/server/router/system" 2 3 import ( 4 "context" 5 "time" 6 7 "github.com/docker/docker/api/types" 8 "github.com/docker/docker/api/types/events" 9 "github.com/docker/docker/api/types/filters" 10 "github.com/docker/docker/api/types/swarm" 11 ) 12 13 // DiskUsageOptions holds parameters for system disk usage query. 14 type DiskUsageOptions struct { 15 // Containers controls whether container disk usage should be computed. 16 Containers bool 17 18 // Images controls whether image disk usage should be computed. 19 Images bool 20 21 // Volumes controls whether volume disk usage should be computed. 22 Volumes bool 23 } 24 25 // Backend is the methods that need to be implemented to provide 26 // system specific functionality. 27 type Backend interface { 28 SystemInfo() *types.Info 29 SystemVersion() types.Version 30 SystemDiskUsage(ctx context.Context, opts DiskUsageOptions) (*types.DiskUsage, error) 31 SubscribeToEvents(since, until time.Time, ef filters.Args) ([]events.Message, chan interface{}) 32 UnsubscribeFromEvents(chan interface{}) 33 AuthenticateToRegistry(ctx context.Context, authConfig *types.AuthConfig) (string, string, error) 34 } 35 36 // ClusterBackend is all the methods that need to be implemented 37 // to provide cluster system specific functionality. 38 type ClusterBackend interface { 39 Info() swarm.Info 40 } 41 42 // StatusProvider provides methods to get the swarm status of the current node. 43 type StatusProvider interface { 44 Status() string 45 }