http

package
v0.0.0-...-97eebd6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeConcatRequest

func DecodeConcatRequest(_ context.Context, r *http.Request) (interface{}, error)

DecodeConcatRequest is a transport/http.DecodeRequestFunc that decodes a JSON-encoded concat request from the HTTP request body. Primarily useful in a server.

func DecodeConcatResponse

func DecodeConcatResponse(_ context.Context, r *http.Response) (interface{}, error)

DecodeConcatResponse is a transport/http.DecodeResponseFunc that decodes a JSON-encoded concat 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 DecodeSumRequest

func DecodeSumRequest(_ context.Context, r *http.Request) (interface{}, error)

DecodeSumRequest is a transport/http.DecodeRequestFunc that decodes a JSON-encoded sum request from the HTTP request body. Primarily useful in a server.

func DecodeSumResponse

func DecodeSumResponse(_ context.Context, r *http.Response) (interface{}, error)

DecodeSumResponse is a transport/http.DecodeResponseFunc that decodes a JSON-encoded sum 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 EncodeGenericRequest

func EncodeGenericRequest(_ context.Context, r *http.Request, request interface{}) error

EncodeGenericRequest is a transport/http.EncodeRequestFunc that JSON-encodes any request to the request body. Primarily useful in a client.

func EncodeGenericResponse

func EncodeGenericResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error

EncodeGenericResponse is a transport/http.EncodeResponseFunc that encodes the response as JSON to the response writer. Primarily useful in a server.

func NewHandler

func NewHandler(ctx context.Context, endpoints endpoints.Endpoints, logger log.Logger, trace stdopentracing.Tracer) http.Handler

NewHandler returns a handler that makes a set of endpoints available on predefined paths.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL