discovery

package
v0.0.0-...-5c8f720 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2016 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotSupported is returned when a discovery service is not supported.
	ErrNotSupported = errors.New("discovery service not supported")

	// ErrNotImplemented is returned when discovery feature is not implemented
	// by discovery backend.
	ErrNotImplemented = errors.New("not implemented in this discovery service")
)

Functions

func Register

func Register(scheme string, d Backend) error

Register makes a discovery backend available by the provided scheme. If Register is called twice with the same scheme an error is returned.

Types

type Backend

type Backend interface {
	// Initialize the discovery with URIs, a heartbeat, a ttl and optional settings.
	Initialize(string, time.Duration, time.Duration, map[string]string) error

	// Register to the discovery
	Register(string, []byte) error
	Watch(string, <-chan struct{}) (<-chan [][]byte, <-chan error)
	Exists(string) (bool, error)
	PutTree(string) error
}

Backend is implemented by discovery backends which manage cluster entries.

func New

func New(rawurl string, heartbeat time.Duration, ttl time.Duration, clusterOpts map[string]string) (Backend, error)

New returns a new Discovery given a URL, heartbeat and ttl settings. Returns an error if the URL scheme is not supported.

Directories

Path Synopsis
Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers.
Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers.

Jump to

Keyboard shortcuts

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