registry

package
v1.1.31 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 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

	//etcd key
	Key string
}

Action watch data change content

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

	// CloseRegistry close registry
	CloseRegistry()
}

func NewRegistry

func NewRegistry() 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