registry

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Name     string
	Version  string
	Metadata map[string]string
	Address  string
}

Entry defines the entry in the registry

type Options

type Options struct {
	Host      string
	Port      uint16
	Timeout   time.Duration
	Secure    bool
	TLSConfig *tls.Config
}

Options is the config for the registry

type Registry

type Registry interface {
	// Init initializes the registry
	Init(opts Options) error
	// Options Returns the registry options
	Options() Options
	// Register adds the service to the registry
	Register(entry Entry) error
	// Deregister removes the service to the registry
	Deregister(serviceName string) error
	// GetService Resolves the servicename and returns the service details
	GetService(serviceName string) ([]Entry, error)
	// ListServices returns all the services in the registry
	ListServices() ([]Entry, error)
	// Watch sets the registry to watch mode so that it tracks any updates
	Watch() error
	// CancelWatch stops the registry watch mode
	CancelWatch() error
}

Registry defines the registry interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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