浏览代码

Add NetworkManager and ClusterStatus interfaces

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 8 年之前
父节点
当前提交
8f4f85dd5b
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      daemon/cluster.go

+ 12 - 0
daemon/cluster.go

@@ -6,6 +6,18 @@ import (
 
 // Cluster is the interface for github.com/docker/docker/daemon/cluster.(*Cluster).
 type Cluster interface {
+	ClusterStatus
+	NetworkManager
+}
+
+// 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) (apitypes.NetworkResource, error)
 	GetNetworks() ([]apitypes.NetworkResource, error)
 	RemoveNetwork(input string) error