Help us shape the future of Go! Take the 2026 Go Developer Survey

gxetcd

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package gxetcd provides an etcd version 3 gxregistry

Package gxetcd provides an etcd version 3 gxregistry ref: https://github.com/micro/go-plugins/blob/master/gxregistry/etcdv3/etcdv3.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRegistry

func NewRegistry(opts ...gxregistry.Option) (gxregistry.Registry, error)

func NewWatcher

func NewWatcher(client *gxetcd.Client, opts ...gxregistry.WatchOption) (gxregistry.Watcher, error)

Types

type Registry

type Registry struct {
	sync.Mutex
	sync.Once
	// contains filtered or unexported fields
}

func (*Registry) Client added in v0.3.2

func (r *Registry) Client() *gxetcd.Client

func (*Registry) Close

func (r *Registry) Close() error

func (*Registry) Deregister

func (r *Registry) Deregister(s gxregistry.Service) error

func (*Registry) GetServices

func (r *Registry) GetServices(attr gxregistry.ServiceAttr) ([]gxregistry.Service, error)

func (*Registry) Options

func (r *Registry) Options() gxregistry.Options

func (*Registry) Register

func (r *Registry) Register(s gxregistry.Service) error

func (*Registry) String

func (r *Registry) String() string

func (*Registry) Watch

func (r *Registry) Watch(opts ...gxregistry.WatchOption) (gxregistry.Watcher, error)

type Watcher

type Watcher struct {
	sync.Once // for Close
	// contains filtered or unexported fields
}

watcher的watch系列函数暴露给registry,而Next函数则暴露给selector

func (*Watcher) Close

func (w *Watcher) Close()

func (*Watcher) IsClosed

func (w *Watcher) IsClosed() bool

check whether the session has been closed.

func (*Watcher) Notify

func (w *Watcher) Notify() (*gxregistry.EventResult, error)

func (*Watcher) Valid

func (w *Watcher) Valid() bool

Jump to

Keyboard shortcuts

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