README
¶
#discovery-stage.hub.docker.com
Docker Swarm comes with a simple discovery service built into the Docker Hub
The discovery service is still in alpha stage and currently hosted at https://discovery-stage.hub.docker.com
#####Create a new cluster
-> POST https://discovery-stage.hub.docker.com/v1/clusters
<- <token>
#####Add new nodes to a cluster
-> POST https://discovery-stage.hub.docker.com/v1/clusters/<token> (data="<ip:port1>")
<- OK
-> POST https://discovery-stage.hub.docker.com/v1/clusters/<token> (data="<ip:port2>")
<- OK
#####List nodes in a cluster
-> GET https://discovery-stage.hub.docker.com/v1/clusters/<token>
<- ["<ip:port1>", "<ip:port2>"]
#####Delete a cluster (all the nodes in a cluster)
-> DELETE https://discovery-stage.hub.docker.com/v1/clusters/<token>
<- OK
Documentation
¶
Index ¶
- Constants
- type TokenDiscoveryService
- func (s *TokenDiscoveryService) CreateCluster() (string, error)
- func (s *TokenDiscoveryService) Fetch() ([]*discovery.Entry, error)
- func (s *TokenDiscoveryService) Initialize(urltoken string, heartbeat int) error
- func (s *TokenDiscoveryService) Register(addr string) error
- func (s *TokenDiscoveryService) Watch(callback discovery.WatchCallback)
Constants ¶
const DiscoveryURL = "https://discovery-stage.hub.docker.com/v1"
DiscoveryUrl is exported
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenDiscoveryService ¶
type TokenDiscoveryService struct {
// contains filtered or unexported fields
}
TokenDiscoveryService is exported
func (*TokenDiscoveryService) CreateCluster ¶
func (s *TokenDiscoveryService) CreateCluster() (string, error)
CreateCluster returns a unique cluster token
func (*TokenDiscoveryService) Fetch ¶
func (s *TokenDiscoveryService) Fetch() ([]*discovery.Entry, error)
Fetch returns the list of entries for the discovery service at the specified endpoint
func (*TokenDiscoveryService) Initialize ¶
func (s *TokenDiscoveryService) Initialize(urltoken string, heartbeat int) error
Initialize is exported
func (*TokenDiscoveryService) Register ¶
func (s *TokenDiscoveryService) Register(addr string) error
Register adds a new entry identified by the into the discovery service
func (*TokenDiscoveryService) Watch ¶
func (s *TokenDiscoveryService) Watch(callback discovery.WatchCallback)
Watch is exported