registry

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Act namespace.WatcherAction
	E   *endpoint.Endpoint
}

Action watch data change content

type Option

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

type Options

type Options func(option *Option)

func Address

func Address(address []string) Options

func EtcdConfig

func EtcdConfig(c *clientv3.Config) Options

func LeaseTLL

func LeaseTLL(leaseTLL int64) Options

func Name

func Name(name string) Options

func Schema

func Schema(schema string) Options

func Timeout

func Timeout(timeout time.Duration) Options

func Version

func Version(version string) Options

type Registry

type Registry interface {

	// Watcher watch the remote like etcd,who's data change
	Watcher

	// Register register a endpoint to etcd or other
	Register(e *endpoint.Endpoint) error

	// Deregister deregister a endpoint from etcd or other
	Deregister(e *endpoint.Endpoint) error

	// Next get one endpoint
	Next(scope string) (*endpoint.Endpoint, error)

	// List get all endpoint
	List() ([]*endpoint.Endpoint, error)

	// Name return the tool's name like "etcd"
	Name() string

	// Close close registry
	Close()
}

func NewRegistry

func NewRegistry(opts ...Options) Registry

NewRegistry create a new registry with etcd

type Watcher

type Watcher interface {
	Watch() chan *Action
}

Jump to

Keyboard shortcuts

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