registry

package
v0.0.0-...-c1f4788 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 9 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 int
const (
	ActionAdd Action = iota
	ActionUpdate
	ActionRemove
)

type Registry

type Registry interface {
	GetService(ctx context.Context, name string) ([]*Service, error)
	Register(ctx context.Context, service Service) error
	Deregister(ctx context.Context, service Service) error

	Watch(ctx context.Context, name string) (Watcher, error)
}

type Service

type Service struct {
	Namespace   string
	ServiceName string
	ServiceID   string
	ServiceAddr string
	Metadata    map[string]string
}

type WatchResult

type WatchResult struct {
	Services []*Service
	Action   Action
	Error    error
}

type Watcher

type Watcher interface {
	Next() (*WatchResult, error)
	Shutdown()
}

Jump to

Keyboard shortcuts

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