Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("no service addresses found")
ErrNotFound is returned when no service addresses are found.
Functions ¶
func GenerateInstanceID ¶
GenerateInstanceID generates a pseudo-random service instance identifier, using a service name suffixed by 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 insttance record from the registry.
Deregister(ctx context.Context, instanceID string, serviceName string) error
// ServiceAddresses returns the list of addresses of active instances of the given service.
ServiceAddresses(ctx context.Context, serviceID string) ([]string, error)
// ReportHealthyState is a push mechanism for reporting healthy sta te to the registry.
ReportHealthyState(instanceID string, serviceName string) error
}
Registry defines a service registry.
Click to show internal directories.
Click to hide internal directories.