Files
moby/daemon/cluster.go
Sebastiaan van Stijn 69b2a05d27 api/types: migrate NetworkResource to api/types/network
This moves the type to the api/types/network package, but also introduces
a "Summary" alias; the intent here is to allow diverging the types used
for "list" and "inspect" operations, as list operations may only be
producing a subset of the fields available.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-04 17:44:46 +02:00

28 lines
797 B
Go

package daemon // import "github.com/docker/docker/daemon"
import (
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/network"
lncluster "github.com/docker/docker/libnetwork/cluster"
)
// Cluster is the interface for github.com/docker/docker/daemon/cluster.(*Cluster).
type Cluster interface {
ClusterStatus
NetworkManager
SendClusterEvent(event lncluster.ConfigEventType)
}
// ClusterStatus interface provides information about the Swarm status of the Cluster
type ClusterStatus interface {
IsAgent() bool
IsManager() bool
}
// NetworkManager provides methods to manage networks
type NetworkManager interface {
GetNetwork(input string) (network.Inspect, error)
GetNetworks(filters.Args) ([]network.Inspect, error)
RemoveNetwork(input string) error
}