http

package
v0.0.0-...-65e2f22 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSONSchema

func DecodeJSONSchema(
	next kithttp.DecodeRequestFunc,
	schema *gojsonschema.Schema,
) kithttp.DecodeRequestFunc

DecodeJSONSchema validates the request payload against the given schema and returns an invalid payload error in case the validation fails.

func ErrorEncoder

func ErrorEncoder(_ context.Context, err error, w http.ResponseWriter)

ErrorEncoder translates domain specific errors to HTTP status codes.

func PopulateRequestContext

func PopulateRequestContext(ctx context.Context, r *http.Request) context.Context

PopulateRequestContext extracts common information about a request and stores it in the context.

func ServerFinalizer

func ServerFinalizer(
	logger log.Logger,
	reqObserve instrument.ObserveRequestFunc,
) kithttp.ServerFinalizerFunc

ServerFinalizer instruments handler calls to expose Prometheus metrics and / log request/response information.

Types

This section is empty.

Jump to

Keyboard shortcuts

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