registry

package
v0.0.0-...-7429660 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Register registers a service in the registry.
	Register(cfg *config.Register) error

	// Deregister removes the service registration.
	Deregister(cfg *config.Register) error

	// ReadManual returns the current manual overrides and
	// their version as seen by the registry.
	ReadManual(KVPath string) (value string, version uint64, err error)

	// WriteManual writes the new value to the registry if the
	// version of the stored document still matchhes version.
	WriteManual(KVPath, value string, version uint64) (ok bool, err error)

	// WatchServices watches the registry for changes in service
	// registration and health and pushes them if there is a difference.
	WatchServices(name string, status []string, dc string) chan []*Cluster

	// WatchManual watches the registry for changes in the manual
	// overrides and pushes them if there is a difference.
	WatchManual(KVPath string) chan string

	// WatchPrefixManual watches the registry for changes in the manual
	// overrides and pushes them if there is a difference.
	WatchPrefixManual(KVPath string) chan map[string]string
}
var Default Backend

type Cluster

type Cluster struct {
	Name      string
	Endpoints []Endpoint
}

Cluster is service all health endpoints

func (*Cluster) AddEnvTag

func (cluster *Cluster) AddEnvTag()

AddEnvTag add default env tag

type Endpoint

type Endpoint struct {
	ID   string
	Addr string
	Port int
	Tags []string
}

Endpoint describe one health cluster instance

type ServiceManager

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

func NewServiceManager

func NewServiceManager(logger *logging.Logger) *ServiceManager

func (*ServiceManager) Deregister

func (bm *ServiceManager) Deregister()

func (*ServiceManager) Register

func (bm *ServiceManager) Register(reg *config.Register) error

Directories

Path Synopsis
Package file implements a simple file based registry backend which reads the routes from a file once.
Package file implements a simple file based registry backend which reads the routes from a file once.
Package static implements a simple static registry backend which uses statically configured routes.
Package static implements a simple static registry backend which uses statically configured routes.

Jump to

Keyboard shortcuts

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