registry

package
v0.0.0-...-5117fa9 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRegistry func(opts ...Option) (Registry, error)

Functions

This section is empty.

Types

type Node

type Node struct {
	Id       string            `json:"id"`
	Address  string            `json:"address"`
	Metadata map[string]string `json:"metadata"`
}

type Option

type Option func(*Options)

func Dsn

func Dsn(dsn string) Option

func TLSConfig

func TLSConfig(t *tls.Config) Option

Specify TLS Config

type Options

type Options struct {
	Timeout   time.Duration
	TLSConfig *tls.Config
	Dsn       string
}

type RegisterOption

type RegisterOption func(*RegisterOptions)

func RegisterTTL

func RegisterTTL(t time.Duration) RegisterOption

type RegisterOptions

type RegisterOptions struct {
	TTL time.Duration
}

type Registry

type Registry interface {
	Register(serviceName string, node *Node, opts ...RegisterOption) error
	Unregister(serviceName string, node *Node) error
	GetClient() interface{}
}

The registry provides an interface for service discovery

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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