Files
moby/daemon/server/router/system/backend.go
Sebastiaan van Stijn 0dcb1fe344 daemon: align build.DiskUsage() with other disk-usages
Move calculation of the data to the builder backend, to align with
the other type of objects. This also allows us to skip the verbose
data if it's not used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-07 19:57:30 +01:00

42 lines
1.4 KiB
Go

package system
import (
"context"
"time"
"github.com/moby/moby/api/types/events"
"github.com/moby/moby/api/types/registry"
"github.com/moby/moby/api/types/swarm"
"github.com/moby/moby/api/types/system"
"github.com/moby/moby/v2/daemon/internal/filters"
"github.com/moby/moby/v2/daemon/server/backend"
"github.com/moby/moby/v2/daemon/server/buildbackend"
)
// Backend is the methods that need to be implemented to provide
// system specific functionality.
type Backend interface {
SystemInfo(context.Context) (*system.Info, error)
SystemVersion(context.Context) (system.VersionResponse, error)
SystemDiskUsage(ctx context.Context, opts backend.DiskUsageOptions) (*backend.DiskUsage, error)
SubscribeToEvents(since, until time.Time, ef filters.Args) ([]events.Message, chan any)
UnsubscribeFromEvents(chan any)
AuthenticateToRegistry(ctx context.Context, authConfig *registry.AuthConfig) (string, error)
}
// ClusterBackend is all the methods that need to be implemented
// to provide cluster system specific functionality.
type ClusterBackend interface {
Info(context.Context) swarm.Info
}
// BuildBackend provides build specific system information.
type BuildBackend interface {
DiskUsage(context.Context, buildbackend.DiskUsageOptions) (*buildbackend.DiskUsage, error)
}
// StatusProvider provides methods to get the swarm status of the current node.
type StatusProvider interface {
Status() string
}