Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPClient ¶
NewHTTPClient returns an *http.Client which will send all HTTP requests to the unix socket at socketPath, and will encode the proper request metadata to make all requests route to Consul
func NewTransport ¶
func NewTransport(socketPath, consulHost string, extras map[string]string) http.RoundTripper
Types ¶
type UnixSocketTransport ¶
type UnixSocketTransport struct { // Transport does the actual work of sending the HTTP requests after // UnixSocketTransport rewrites certain request metadata *http.Transport // The name of Consul added as the request host header ConsulHost string }
UnixSocketTransport provides an http.RoundTripper that wraps around another RoundTripper, adding needed metadata to each request
func (UnixSocketTransport) RoundTrip ¶
RoundTrip implements the http.RoundTripper interface. It modifies the HTTP request to inject the necessary request metadata for the request to be route the request to the right place. The modified HTTP request is then passed to the wrapped *http.Transport (also an implementation of RoundTripper).
Click to show internal directories.
Click to hide internal directories.