token

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2015 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

#discovery.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 http://discovery-stage.hub.docker.com

#####Create a new cluster -> POST http://discovery.hub.docker.com/v1/clusters (data="")

<- <token>

#####Add new nodes to a cluster -> POST http://discovery.hub.docker.com/v1/clusters/<token> (data="<ip:port1>")

<- OK

-> POST http://discovery.hub.docker.com/v1/clusters/token (data="<ip:port2>")

<- OK

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

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

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

<- OK

Documentation

Index

Constants

View Source
const DISCOVERY_URL = "https://discovery-stage.hub.docker.com/v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenDiscoveryService

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

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

func (*TokenDiscoveryService) Register

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

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

func (*TokenDiscoveryService) Watch

func (s *TokenDiscoveryService) Watch(callback discovery.WatchCallback)

Jump to

Keyboard shortcuts

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