irsa

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

filename: 2xx.go author: Thomas Lombard copyright: Thomas Lombard license: MIT status: published

filename: error.go author: Thomas Lombard copyright: Thomas Lombard license: MIT status: published

filename: respond.go author: Thomas Lombard copyright: Thomas Lombard license: MIT status: published

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(err error, ctx echo.Context)

func RawSend

func RawSend(c echo.Context, httpCode int, data interface{}) error

func Send

func Send(c echo.Context, httpCode int, payload interface{}) error

func SendAccepted

func SendAccepted(c echo.Context, body interface{}) error

Description :

This function is a short hand for sending a http 202 response

Parameters :

     c echo.Context :
         The current request context from echo. Must never be set to nil.
		body interface{} :
			The body to send as response if there must be one.
		message ...interface{} :
			Informations about the response. Used to fill the message field of the response template.

Returns :

error :
	The encountered error if there has one. Nil otherwise

func SendCreated

func SendCreated(c echo.Context, body interface{}) error

Description :

This function is a short hand for sending a http 201 response

Parameters :

     c echo.Context :
         The current request context from echo. Must never be set to nil.
		body interface{} :
			Must be the created ressource.
		message ...interface{} :
			Informations about the response. Used to fill the message field of the response template.

Returns :

error :
	The encountered error if there has one. Nil otherwise

func SendError

func SendError(c echo.Context, err error) error

func SendNoContent

func SendNoContent(c echo.Context) error

Description :

This function is a short hand for sending a http 204 response

Parameters :

     c echo.Context :
         The current request context from echo. Must never be set to nil.
		message ...interface{} :
			Informations about the response. Used to fill the message field of the response template.

Returns :

error :
	The encountered error if there has one. Nil otherwise

func SendOk

func SendOk(c echo.Context, body interface{}) error

Description :

This function is a short hand for sending a http 200 response

Parameters :

     c echo.Context :
         The current request context from echo. Must never be set to nil.
		body interface{} :
			The body to send as response
		message ...interface{} :
			Informations about the response. Used to fill the message field of the response template.

Returns :

error :
	The encountered error if there has one. Nil otherwise

func SendPartialContent

func SendPartialContent(c echo.Context, body interface{}) error

Description :

This function is a short hand for sending a http 206 response

Parameters :

     c echo.Context :
         The current request context from echo. Must never be set to nil.
		body interface{} :
			The part of the response
		message ...interface{} :
			Informations about the response. Used to fill the message field of the response template.

Returns :

error :
	The encountered error if there has one. Nil otherwise

func SendResetContent

func SendResetContent(c echo.Context, body interface{}) error

Description :

This function is a short hand for sending a http 205 response

Parameters :

     c echo.Context :
         The current request context from echo. Must never be set to nil.
		body interface{} :
			The new ressource value
		message ...interface{} :
			Informations about the response. Used to fill the message field of the response template.

Returns :

error :
	The encountered error if there has one. Nil otherwise

Types

This section is empty.

Jump to

Keyboard shortcuts

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