respond

package
v0.0.0-...-f05d2e9 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2015 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Data

func Data(ctx context.Context, w http.ResponseWriter, status int, data interface{})

Data returns a JSON response with the provided data and HTTP status code.

func InternalError

func InternalError(ctx context.Context, w http.ResponseWriter, err error)

InternalError returns an InternalFailure error with a 500 status code and logs the error stacktrace.

func NotFound

func NotFound(ctx context.Context, w http.ResponseWriter, _ *http.Request)

NotFound returns a JSON NotFound response with a 404 status.

func UserError

func UserError(ctx context.Context, w http.ResponseWriter, status int, uerr usererrors.UserError)

UserError returns a JSON response for the provided UserError and HTTP status code.

func WrapPanicC

func WrapPanicC(h goji.Handler) goji.Handler

WrapPanicC wraps a goji.Handler to catch panics, log relevant information and return an InternalFailure to the user.

Types

This section is empty.

Jump to

Keyboard shortcuts

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