zookeeper

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWatcherStopped = errors.New("watcher stopped")

Functions

func NewDiscovery added in v0.2.0

func NewDiscovery(c *conf.Registry) (registry.Discovery, error)

func NewRegistrar added in v0.2.0

func NewRegistrar(c *conf.Registry) (registry.Registrar, error)

Types

type Option added in v0.1.0

type Option func(o *options)

Option is etcd registry option.

func WithDigestACL added in v0.1.0

func WithDigestACL(user string, password string) Option

WithDigestACL with registry password.

func WithRootPath added in v0.1.0

func WithRootPath(path string) Option

WithRootPath with registry root path.

type Registry added in v0.1.0

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

Registry is consul registry

func New added in v0.1.0

func New(conn *zk.Conn, opts ...Option) *Registry

func NewRegistry

func NewRegistry(c *conf.Registry) (*Registry, error)

NewRegistry 创建一个注册发现客户端 - ZooKeeper

func (*Registry) Deregister added in v0.1.0

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

Deregister registry service to zookeeper.

func (*Registry) GetService added in v0.1.0

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

GetService get services from zookeeper

func (*Registry) Register added in v0.1.0

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

func (*Registry) Watch added in v0.1.0

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