httpreply

package
v0.0.0-...-a556200 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 2 Imported by: 0

Documentation

Overview

Package httpreply implements common replies for http requests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alive

func Alive(w http.ResponseWriter, cmaperr error) (err error)

Alive is standard response for liveness probe

func CMAPError

func CMAPError(w http.ResponseWriter, description string) (err error)

CMAPError writes standard response for cloneMAP Error

func Created

func Created(w http.ResponseWriter, cmaperr error, content string, answer []byte) (err error)

Created writes standard response for ressource creation

func Deleted

func Deleted(w http.ResponseWriter, cmaperr error) (err error)

Deleted writes standard response for ressource deleteion

func InvalidBodyError

func InvalidBodyError(w http.ResponseWriter) (err error)

InvalidBodyError writes standard response for Invalid Body Error

func JSONMarshalError

func JSONMarshalError(w http.ResponseWriter) (err error)

JSONMarshalError writes standard response for JSON Marshal Error

func JSONUnmarshalError

func JSONUnmarshalError(w http.ResponseWriter) (err error)

JSONUnmarshalError writes standard response for JSON Unmarshal Error

func MethodNotAllowed

func MethodNotAllowed(w http.ResponseWriter) (err error)

MethodNotAllowed writes standard response if requested method is not allowed

func NotFoundError

func NotFoundError(w http.ResponseWriter) (err error)

NotFoundError writes standard response for Ressource not found Error

func Resource

func Resource(w http.ResponseWriter, v interface{}, cmaperr error) (err error)

Resource writes standard response for ressource get

func Updated

func Updated(w http.ResponseWriter, cmaperr error) (err error)

Updated writes standard response for ressource update

Types

This section is empty.

Jump to

Keyboard shortcuts

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