discovery

package module
v0.0.0-...-58ec5a9 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2015 License: MIT Imports: 6 Imported by: 15

README

go-discovery

Utility for register and interfacing with discovery service

Documentation

Index

Constants

View Source
const (
	DefaultHeartbeat = 2 * time.Minute
	DefaultTTL       = 2*time.Minute + 30*time.Second
)

Variables

View Source
var (
	RegisterPath = "/srv/monitor"

	Discovery string

	Hearbeat time.Duration
	TTL      time.Duration

	Cancel ctx.CancelFunc
)

Functions

func Endpoints

func Endpoints() []string

func NewDiscovery

func NewDiscovery() (client etcd.Client)

func NewKeysAPI

func NewKeysAPI(cfg etcd.Config) (etcd.KeysAPI, error)

func NewWatcher

func NewWatcher(opts *WatcherOptions) (etcd.Watcher, error)

func Register

func Register(heartbeat time.Duration, ttl time.Duration)

Types

type WatcherOptions

type WatcherOptions struct {
	Config etcd.Config

	Key string

	AfterIndex uint64
	Recursive  bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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