registry

package
v0.0.0-...-2c19b2c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultRegistry = newConsulRegistry([]string{})
)

Functions

func Deregister

func Deregister(s *Service) error

func Register

func Register(s *Service) error

Types

type Endpoint

type Endpoint struct {
	Name     string
	Request  *Value
	Response *Value
	Metadata map[string]string
}

type Node

type Node struct {
	Id       string
	Address  string
	Port     int
	Metadata map[string]string
}

type Option

type Option func(*options)

type Registry

type Registry interface {
	Register(*Service) error
	Deregister(*Service) error
	GetService(string) (*Service, error)
	ListServices() ([]*Service, error)
	Watch() (Watcher, error)
}

func NewRegistry

func NewRegistry(addrs []string, opt ...Option) Registry

type Service

type Service struct {
	Name      string
	Version   string
	Metadata  map[string]string
	Endpoints []*Endpoint
	Nodes     []*Node
}

func GetService

func GetService(name string) (*Service, error)

func ListServices

func ListServices() ([]*Service, error)

type Value

type Value struct {
	Name   string
	Type   string
	Values []*Value
}

type Watcher

type Watcher interface {
	Stop()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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