community: github.com/documize/community/core/response Index | Files

package response

import "github.com/documize/community/core/response"

Package response provides functions to write HTTP response.

Index

Package Files

write.go

func WriteBadLicense Uses

func WriteBadLicense(w http.ResponseWriter)

WriteBadLicense notifies HTTP client of invalid license (402)

func WriteBadRequestError Uses

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

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

func WriteBytes Uses

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

WriteBytes dumps bytes to HTTP response

func WriteDuplicateError Uses

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

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

func WriteEmpty Uses

func WriteEmpty(w http.ResponseWriter)

WriteEmpty writes empty JSON HTTP response

func WriteError Uses

func WriteError(w http.ResponseWriter, method string)

WriteError notifies HTTP client of general application error.

func WriteForbiddenError Uses

func WriteForbiddenError(w http.ResponseWriter)

WriteForbiddenError notifies HTTP client of request that is not allowed.

func WriteJSON Uses

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

WriteJSON serializes data as JSON to HTTP response.

func WriteMissingDataError Uses

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

WriteMissingDataError notifies HTTP client of missing data in request.

func WriteNotFound Uses

func WriteNotFound(w http.ResponseWriter)

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

func WriteNotFoundError Uses

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

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

func WriteServerError Uses

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

WriteServerError notifies HTTP client of general application error.

func WriteString Uses

func WriteString(w http.ResponseWriter, data string)

WriteString writes string to HTTP response

func WriteUnauthorizedError Uses

func WriteUnauthorizedError(w http.ResponseWriter)

WriteUnauthorizedError notifies HTTP client of rejected unauthorized request.

Package response imports 2 packages (graph) and is imported by 26 packages. Updated 2018-12-04. Refresh now. Tools for package owners.