etcd

package module
v2.0.7-feature-clickho... Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: MIT Imports: 9 Imported by: 18

Documentation

Overview

Package etcd implements service Registry and Discovery using etcd.

Index

Constants

View Source
const (
	DefaultKeepAliveTTL = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	Logger       *glog.Logger
	KeepaliveTTL time.Duration
}

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func New

func New(address string, option ...Option) *Registry

func NewWithClient

func NewWithClient(client *etcd3.Client, option ...Option) *Registry

func (*Registry) Deregister

func (r *Registry) Deregister(ctx context.Context, service *gsvc.Service) error

func (*Registry) Register

func (r *Registry) Register(ctx context.Context, service *gsvc.Service) error

func (*Registry) Search

func (r *Registry) Search(ctx context.Context, in gsvc.SearchInput) ([]*gsvc.Service, error)

func (*Registry) Watch

func (r *Registry) Watch(ctx context.Context, key string) (gsvc.Watcher, error)

Jump to

Keyboard shortcuts

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