registry

package
v0.0.0-...-03b0c02 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *options)

Option is etcd registry option.

func WithContext

func WithContext(ctx context.Context) Option

WithContext with registry context.

func WithRootPath

func WithRootPath(path string) Option

WithRootPath with registry root path.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout with registry timeout.

type Registry

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

Registry is consul registry

func New

func New(zkServers []string, opts ...Option) (*Registry, error)

func (*Registry) Deregister

func (r *Registry) Deregister(ctx context.Context, service *registry.ServiceInstance) error

Deregister registry service to zookeeper.

func (*Registry) GetService

func (r *Registry) GetService(ctx context.Context, serviceName string) ([]*registry.ServiceInstance, error)

GetService get services from zookeeper

func (*Registry) Register

func (r *Registry) Register(ctx context.Context, service *registry.ServiceInstance) error

func (*Registry) Watch

func (r *Registry) Watch(ctx context.Context, serviceName string) (registry.Watcher, error)

Jump to

Keyboard shortcuts

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