response

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InternalServerError

func InternalServerError(rw http.ResponseWriter, r *http.Request)

InternalServerError is an http handler that returns a JSON response when an error that can not be managed by the handler is encountered during requests handling

func JSON

func JSON(w http.ResponseWriter, body interface{})

JSON is a convenient function to write a JSON object as response to the incoming request

func MethodNotAllowed

func MethodNotAllowed(rw http.ResponseWriter, r *http.Request)

MethodNotAllowed is an http handler that return a JSON response when the method of current request has not been defined for current route

func NotFound

func NotFound(rw http.ResponseWriter, r *http.Request)

NotFound is an http handler that return a JSON response when requested resource is not found at the current route

func PanicManager

func PanicManager(next http.Handler) http.Handler

PanicManager return a middleware function that recover service from panic situations, by returning an Interal Server Error response

Types

This section is empty.

Jump to

Keyboard shortcuts

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