discovery

package
v0.0.0-...-350df58 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("no service address found")

ErrNotFound is returned when no service address is found.

Functions

func GenerateInstanceID

func GenerateInstanceID(serviceName string) string

GenerateInstanceID generates a pseudo-random service instance identifier using a service name suffixed by a dash and a random number.

Types

type Registry

type Registry interface {
	// Register creates a service instance record in the registry.
	Register(ctx context.Context, instanceID string, serviceName string, hostPort string) error
	// Deregister removes a service instance record from the registry.
	Deregister(ctx context.Context, instanceID string, serviceName string) error
	// ServiceAddress returns the list of address of active
	// instances of the given service.
	ServiceAddress(ctx context.Context, serviceName string) ([]string, error)
	// ReportHealthyState is a push mechanism for reporting healthy state
	// to the registry
	ReportHealthyState(instanceID string, serviceName string) error
}

Registry defines a service registry.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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