etcdx

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 8 Imported by: 1

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"`
	//CertFile           string `json:",optional"`
	//CertKeyFile        string `json:",optional=CertFile"`
	//CACertFile         string `json:",optional=CertFile"`
	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