Documentation ¶
Index ¶
- func Data(ctx context.Context, w http.ResponseWriter, status int, data interface{})
- func InternalError(ctx context.Context, w http.ResponseWriter, err error)
- func NotFound(ctx context.Context, w http.ResponseWriter, _ *http.Request)
- func UserError(ctx context.Context, w http.ResponseWriter, status int, ...)
- func WrapPanicC(h goji.Handler) goji.Handler
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 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.
Click to show internal directories.
Click to hide internal directories.