Documentation ¶
Overview ¶
Package http provides an HTTP client for the Current service.
Index ¶
- func DecodeHTTPGetLocationResponse(_ context.Context, r *http.Response) (interface{}, error)
- func DecodeHTTPPostLocationBigBrotherResponse(_ context.Context, r *http.Response) (interface{}, error)
- func DecodeHTTPPostLocationTaskerResponse(_ context.Context, r *http.Response) (interface{}, error)
- func EncodeHTTPGetLocationZeroRequest(_ context.Context, r *http.Request, request interface{}) error
- func EncodeHTTPPostLocationBigBrotherZeroRequest(_ context.Context, r *http.Request, request interface{}) error
- func EncodeHTTPPostLocationTaskerZeroRequest(_ context.Context, r *http.Request, request interface{}) error
- func New(instance string, options ...ClientOption) (pb.CurrentServer, error)
- type ClientOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeHTTPGetLocationResponse ¶
DecodeHTTPGetLocationResponse is a transport/http.DecodeResponseFunc that decodes a JSON-encoded Location response from the HTTP response body. If the response has a non-200 status code, we will interpret that as an error and attempt to decode the specific error message from the response body. Primarily useful in a client.
func DecodeHTTPPostLocationBigBrotherResponse ¶
func DecodeHTTPPostLocationBigBrotherResponse(_ context.Context, r *http.Response) (interface{}, error)
DecodeHTTPPostLocationBigBrotherResponse is a transport/http.DecodeResponseFunc that decodes a JSON-encoded Empty response from the HTTP response body. If the response has a non-200 status code, we will interpret that as an error and attempt to decode the specific error message from the response body. Primarily useful in a client.
func DecodeHTTPPostLocationTaskerResponse ¶
DecodeHTTPPostLocationTaskerResponse is a transport/http.DecodeResponseFunc that decodes a JSON-encoded Empty response from the HTTP response body. If the response has a non-200 status code, we will interpret that as an error and attempt to decode the specific error message from the response body. Primarily useful in a client.
func EncodeHTTPGetLocationZeroRequest ¶
func EncodeHTTPGetLocationZeroRequest(_ context.Context, r *http.Request, request interface{}) error
EncodeHTTPGetLocationZeroRequest is a transport/http.EncodeRequestFunc that encodes a getlocation request into the various portions of the http request (path, query, and body).
func EncodeHTTPPostLocationBigBrotherZeroRequest ¶
func EncodeHTTPPostLocationBigBrotherZeroRequest(_ context.Context, r *http.Request, request interface{}) error
EncodeHTTPPostLocationBigBrotherZeroRequest is a transport/http.EncodeRequestFunc that encodes a postlocationbigbrother request into the various portions of the http request (path, query, and body).
func EncodeHTTPPostLocationTaskerZeroRequest ¶
func EncodeHTTPPostLocationTaskerZeroRequest(_ context.Context, r *http.Request, request interface{}) error
EncodeHTTPPostLocationTaskerZeroRequest is a transport/http.EncodeRequestFunc that encodes a postlocationtasker request into the various portions of the http request (path, query, and body).
func New ¶
func New(instance string, options ...ClientOption) (pb.CurrentServer, error)
New returns a service backed by an HTTP server living at the remote instance. We expect instance to come from a service discovery system, so likely of the form "host:port".
Types ¶
type ClientOption ¶
type ClientOption func(*clientConfig) error
ClientOption is a function that modifies the client config
func CtxValuesToSend ¶
func CtxValuesToSend(keys ...string) ClientOption
CtxValuesToSend configures the http client to pull the specified keys out of the context and add them to the http request as headers. Note that keys will have net/http.CanonicalHeaderKey called on them before being send over the wire and that is the form they will be available in the server context.