Documentation
¶
Index ¶
Constants ¶
const ( RegisterInstance Operation = "Register" DeregisterInstance = "Deregister" RenewInstance = "Renew" ListServices = "ListServices" ListServiceInstances = "ListServiceInstances" ListInstances = "ListInstances" SetInstanceStatus = "SetStatus" GetInstance = "GetInfo" )
The following are the current API operations exposed by Service Discovery.
While most operations have implementations in both API protocols (Amalgam8 / Eureka), some are unique to a certain protocol - e.g., SetInstanceStatus is currently unique to Eureka).
Also, several sub-operations may be mapped to the same Operation value, e.g. Amalgam8's ListInstances as well as Eureka's ListVips are both mapped to ListInstances.
Variables ¶
This section is empty.
Functions ¶
func APIHandler ¶
func APIHandler(handler rest.HandlerFunc, protocol Type, operation Operation) rest.HandlerFunc
APIHandler returns a wrapper HandlerFunc that injects API information into the HTTP request's context (r.Env), before calling the provided HandlerFunc. The given protocol is injected as the env.APIProtocol, and the given operation as the env.APIOperation.
Types ¶
type APIDescriptor ¶
type APIDescriptor struct { // The path part of the URL. Path string // The HTTP method (e.g. "GET"). Valid values are defined in the MethodXXX constants in the http package. Method string // The protocol (e.g., Eureka). Protocol Type // The logic operation (e.g., RegisterInstance). Operation Operation // The handler registered for this API call. Handler rest.HandlerFunc }
APIDescriptor encapsulates information associated with an API call.
func (*APIDescriptor) AsRoute ¶
func (desc *APIDescriptor) AsRoute() *rest.Route
AsRoute converts this APIDescriptor into a rest.Route object.