registry

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 6 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 Schema

func Schema(schema string) Options

func Timeout

func Timeout(timeout time.Duration) 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