token

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

README

#discovery.hub.docker.com

Docker Swarm comes with a simple discovery service built into the Docker Hub

#####Create a new cluster -> POST https://discovery.hub.docker.com/v1/clusters

<- <token>

#####Add new nodes to a cluster -> POST https://discovery.hub.docker.com/v1/clusters/<token>?ttl=<ttl> Request body: "<ip>:<port1>"

<- OK

-> POST https://discovery.hub.docker.com/v1/clusters/<token>?ttl=<ttl> Request body: "<ip>:<port2>")

<- OK

#####List nodes in a cluster -> GET https://discovery.hub.docker.com/v1/clusters/<token>

<- ["<ip>:<port1>", "<ip>:<port2>"]

#####Delete a cluster (all the nodes in a cluster) -> DELETE https://discovery.hub.docker.com/v1/clusters/<token>

<- OK

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init added in v0.3.0

func Init()

Init is exported

Types

type Discovery added in v0.3.0

type Discovery struct {
	// contains filtered or unexported fields
}

Discovery is exported

func (*Discovery) CreateCluster added in v0.3.0

func (s *Discovery) CreateCluster() (string, error)

CreateCluster returns a unique cluster token

func (*Discovery) Initialize added in v0.3.0

func (s *Discovery) Initialize(urltoken string, heartbeat time.Duration, ttl time.Duration, _ map[string]string) error

Initialize is exported

func (*Discovery) Register added in v0.3.0

func (s *Discovery) Register(addr string) error

Register adds a new entry identified by the into the discovery service

func (*Discovery) Watch added in v0.3.0

func (s *Discovery) Watch(stopCh <-chan struct{}) (<-chan discovery.Entries, <-chan error)

Watch is exported

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL