cluster.go 816 B

123456789101112131415161718192021222324252627
  1. package daemon // import "github.com/docker/docker/daemon"
  2. import (
  3. apitypes "github.com/docker/docker/api/types"
  4. "github.com/docker/docker/api/types/filters"
  5. lncluster "github.com/docker/docker/libnetwork/cluster"
  6. )
  7. // Cluster is the interface for github.com/docker/docker/daemon/cluster.(*Cluster).
  8. type Cluster interface {
  9. ClusterStatus
  10. NetworkManager
  11. SendClusterEvent(event lncluster.ConfigEventType)
  12. }
  13. // ClusterStatus interface provides information about the Swarm status of the Cluster
  14. type ClusterStatus interface {
  15. IsAgent() bool
  16. IsManager() bool
  17. }
  18. // NetworkManager provides methods to manage networks
  19. type NetworkManager interface {
  20. GetNetwork(input string) (apitypes.NetworkResource, error)
  21. GetNetworks(filters.Args) ([]apitypes.NetworkResource, error)
  22. RemoveNetwork(input string) error
  23. }