service

package
v2.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEARTBEAT_DURATION = 5
)

Variables

This section is empty.

Functions

func Client

func Client() *etcd.Client

func IsKeyAlreadyExistError

func IsKeyAlreadyExistError(err error) bool

func IsKeyNotFoundError

func IsKeyNotFoundError(err error) bool

func Register

func Register(service string, host *Host, stop chan struct{}) (chan struct{}, error)

func Subscribe

func Subscribe(service string) (<-chan *etcd.Response, <-chan *etcd.EtcdError)

func SubscribeDown

func SubscribeDown(service string) (<-chan string, <-chan *etcd.EtcdError)

func SubscribeNew

func SubscribeNew(service string) (<-chan *Host, <-chan *etcd.EtcdError)

func SubscribeUpdate

func SubscribeUpdate(service string) (<-chan *Host, <-chan *etcd.EtcdError)

Types

type Host

type Host struct {
	Name     string `json:"name"`
	Ports    Ports  `json:"ports"`
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
}

func Get

func Get(service string) ([]*Host, error)

func NewHost

func NewHost(hostname string, ports Ports, params ...string) (*Host, error)

func (*Host) Url

func (h *Host) Url(scheme, path string) (string, error)

type Ports

type Ports map[string]string

Jump to

Keyboard shortcuts

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