2016-05-24 16:17:19 -07:00
|
|
|
package cluster
|
|
|
|
|
2016-08-22 18:36:12 -07:00
|
|
|
import (
|
2016-09-07 13:32:35 -07:00
|
|
|
"github.com/docker/docker/api/types/network"
|
2016-08-22 18:36:12 -07:00
|
|
|
"golang.org/x/net/context"
|
|
|
|
)
|
|
|
|
|
2017-05-03 11:18:33 -07:00
|
|
|
const (
|
|
|
|
// EventSocketChange control socket changed
|
|
|
|
EventSocketChange = iota
|
|
|
|
// EventNodeReady cluster node in ready state
|
|
|
|
EventNodeReady
|
|
|
|
// EventNodeLeave node is leaving the cluster
|
|
|
|
EventNodeLeave
|
|
|
|
// EventNetworkKeysAvailable network keys correctly configured in the networking layer
|
|
|
|
EventNetworkKeysAvailable
|
|
|
|
)
|
|
|
|
|
|
|
|
// ConfigEventType type of the event produced by the cluster
|
|
|
|
type ConfigEventType uint8
|
|
|
|
|
2016-05-24 16:17:19 -07:00
|
|
|
// Provider provides clustering config details
|
|
|
|
type Provider interface {
|
|
|
|
IsManager() bool
|
|
|
|
IsAgent() bool
|
2016-07-19 18:17:30 -07:00
|
|
|
GetLocalAddress() string
|
2016-09-22 11:38:35 -07:00
|
|
|
GetListenAddress() string
|
2016-07-19 18:17:30 -07:00
|
|
|
GetAdvertiseAddress() string
|
2017-04-12 18:51:01 -07:00
|
|
|
GetDataPathAddress() string
|
2017-04-27 16:58:42 -07:00
|
|
|
GetRemoteAddressList() []string
|
2017-05-03 11:18:33 -07:00
|
|
|
ListenClusterEvents() <-chan ConfigEventType
|
2016-08-22 18:36:12 -07:00
|
|
|
AttachNetwork(string, string, []string) (*network.NetworkingConfig, error)
|
|
|
|
DetachNetwork(string, string) error
|
|
|
|
UpdateAttachment(string, string, *network.NetworkingConfig) error
|
2016-08-31 12:22:36 -07:00
|
|
|
WaitForDetachment(context.Context, string, string, string, string) error
|
2016-05-24 16:17:19 -07:00
|
|
|
}
|