response

package
v1.64.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2018 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package response provides functions to write HTTP response.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteBadLicense

func WriteBadLicense(w http.ResponseWriter)

WriteBadLicense notifies HTTP client of invalid license (402)

func WriteBadRequestError

func WriteBadRequestError(w http.ResponseWriter, method, message string)

WriteBadRequestError notifies HTTP client of rejected request due to bad data within request.

func WriteBytes

func WriteBytes(w http.ResponseWriter, data []byte)

WriteBytes dumps bytes to HTTP response

func WriteDuplicateError

func WriteDuplicateError(w http.ResponseWriter, method, entity string)

WriteDuplicateError notifies HTTP client of duplicate data that has been rejected.

func WriteEmpty

func WriteEmpty(w http.ResponseWriter)

WriteEmpty writes empty JSON HTTP response

func WriteForbiddenError

func WriteForbiddenError(w http.ResponseWriter)

WriteForbiddenError notifies HTTP client of request that is not allowed.

func WriteJSON

func WriteJSON(w http.ResponseWriter, v interface{})

WriteJSON serializes data as JSON to HTTP response.

func WriteMissingDataError

func WriteMissingDataError(w http.ResponseWriter, method, parameter string)

WriteMissingDataError notifies HTTP client of missing data in request.

func WriteNotFound added in v1.58.0

func WriteNotFound(w http.ResponseWriter)

WriteNotFound notifies HTTP client of 'record not found' error.

func WriteNotFoundError

func WriteNotFoundError(w http.ResponseWriter, method string, id string)

WriteNotFoundError notifies HTTP client of 'record not found' error.

func WriteServerError

func WriteServerError(w http.ResponseWriter, method string, err error)

WriteServerError notifies HTTP client of general application error.

func WriteString

func WriteString(w http.ResponseWriter, data string)

WriteString writes string to HTTP response

func WriteUnauthorizedError

func WriteUnauthorizedError(w http.ResponseWriter)

WriteUnauthorizedError notifies HTTP client of rejected unauthorized request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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