etcd

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discovery

func Discovery(client *clientv3.Client, registryDir, srvName string) ([]resolver.Address, error)

func RegisterResolver

func RegisterResolver(scheme string, cli *clientv3.Client, registryDir, srvName string)

Types

type Option

type Option struct {
	RegistryDir string
	ServiceName string
	ServiceAddr string
	ServiceData map[string]interface{}
	Ttl         time.Duration
}

type Registry

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

func NewRegistry

func NewRegistry(client *clientv3.Client, option Option) *Registry

func (*Registry) Register

func (e *Registry) Register(stopCh <-chan struct{}) (err error)

func (*Registry) UnRegister

func (e *Registry) UnRegister()

type Watcher

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

func (*Watcher) Close

func (w *Watcher) Close()

func (*Watcher) GetAllAddresses

func (w *Watcher) GetAllAddresses() []resolver.Address

func (*Watcher) Watch

func (w *Watcher) Watch() chan []resolver.Address

Jump to

Keyboard shortcuts

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