Documentation ¶
Overview ¶
Package registry defines the Registry interface which can be used with goproxy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrServiceNotFound = errors.New("service name/version not found")
)
Common errors.
Functions ¶
This section is empty.
Types ¶
type DefaultRegistry ¶
DefaultRegistry is a basic registry using the following format:
{ "serviceName": { "serviceVersion": [ "endpoint1:port", "endpoint2:port" ], }, }
func (DefaultRegistry) Add ¶
func (r DefaultRegistry) Add(name, version, endpoint string)
Add adds the given endpoit for the service name/version.
func (DefaultRegistry) Delete ¶
func (r DefaultRegistry) Delete(name, version, endpoint string)
Delete removes the given endpoit for the service name/version.
func (DefaultRegistry) Failure ¶
func (r DefaultRegistry) Failure(name, version, endpoint string, err error)
Failure marks the given endpoint for service name/version as failed.
type Registry ¶
type Registry interface { Add(name, version, endpoint string) // Add an endpoint to our registry Delete(name, version, endpoint string) // Remove an endpoint to our registry Failure(name, version, endpoint string, err error) // Mark an endpoint as failed. Lookup(name, version string) ([]string, error) // Return the endpoint list for the given service name/version }
Registry is an interface used to lookup the target host for a given service name / version pair.
Click to show internal directories.
Click to hide internal directories.