Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHandler ¶
type AuthHandler struct {
// Service is the service containing the auth handler.
Service ServiceName
Name string // name of the auth handler
// Parameters that the auth handler expects.
// If any one of these are present in the request,
// the auth handler is invoked.
Query []Param
Header []Param
Cookie []Param
}
AuthHandler describes the auth handler.
type Description ¶
type Description struct {
// Routes are the routes to proxy.
Routes []*Route
// Services defines how to proxy traffic to each service.
Services map[ServiceName]Service
// Auth describes the authentication handler, if any.
Auth *AuthHandler
}
Description describes a gateway.
type Gateway ¶
type Gateway struct {
// Rewrite allows for rewriting the request before it is proxied.
// If nil it does nothing.
Rewrite func(p *httputil.ProxyRequest)
// RoundTripper is the http.RoundTripper to use. It defaults to http.DefaultTransport.
RoundTripper http.RoundTripper
// ExtraRoutes, if non-nil, specifies a router that will be consulted first.
// Requests will be proxied to the backend only if the router has no matching path.
ExtraRoutes *mux.Router
// contains filtered or unexported fields
}
Gateway implements a gateway that validates and authenticates incoming requests, and forwards them to the appropriate service.
type Param ¶
type Param struct {
// WireFormat is the name of the parameter on the wire.
WireFormat string
// CaseSensitive specifies whether or not
// the wire format is case sensitive.
CaseSensitive bool
}
Param describes a request parameter.
type RetryDialer ¶
RetryDialer wraps another dialer and adds exponential backoff in the case of connection refused errors.
func (*RetryDialer) DialContext ¶
type Route ¶
type Route struct {
Methods []string // HTTP methods
Path string // "/path/:param/*wildcard"
Dest ServiceName // where to route the request
// RequiresAuth specifies whether the route requires authentication.
RequiresAuth bool
}
Route defines a single route in the gateway.
Click to show internal directories.
Click to hide internal directories.