etcdx

package
v0.0.0-...-535fc81 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWatcher

func NewWatcher(ctx context.Context, client *clientv3.Client, key string) (*watcher, error)

Types

type Conf

type Conf struct {
	Hosts              []string `yaml:"hosts"`
	User               string   `yaml:"user"`
	Pass               string   `yaml:"pass"`
	InsecureSkipVerify bool     `json:""`
}

Conf is the config item with the given key on etcd.

func (*Conf) Empty

func (c *Conf) Empty() bool

type Option

type Option func(options *Options)

type Options

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

type Registry

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

func New

func New(conf Conf, fns ...Option) (*Registry, error)

func (*Registry) DeRegister

func (r *Registry) DeRegister(ctx context.Context, instance *registry.Instance) error

func (*Registry) Register

func (r *Registry) Register(ctx context.Context, instance *registry.Instance) 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