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 ¶
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.
Click to show internal directories.
Click to hide internal directories.