Documentation ¶
Index ¶
- func HandleError(w http.ResponseWriter, err error)
- func SendBadRequestResponse(w http.ResponseWriter, object interface{})
- func SendBasicAtzErrorResponse(w http.ResponseWriter, realm string)
- func SendBearerAtzErrorResponse(w http.ResponseWriter, realm string, err string, errDesc string)
- func SendCreatedResponse(w http.ResponseWriter, object interface{})
- func SendEmptyListResponse(w http.ResponseWriter)
- func SendInternalErrorResponse(w http.ResponseWriter, object interface{})
- func SendOKResponse(w http.ResponseWriter, object interface{})
- func SendPageNotFoundResponse(w http.ResponseWriter)
- func SendResponse(w http.ResponseWriter, statusCode int, object interface{})
- func VerifyContentType(w http.ResponseWriter, r *http.Request, expectedContentTypes []string) bool
- type ErrorResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleError ¶
func HandleError(w http.ResponseWriter, err error)
func SendBadRequestResponse ¶
func SendBadRequestResponse(w http.ResponseWriter, object interface{})
func SendBasicAtzErrorResponse ¶
func SendBasicAtzErrorResponse(w http.ResponseWriter, realm string)
func SendBearerAtzErrorResponse ¶
func SendBearerAtzErrorResponse(w http.ResponseWriter, realm string, err string, errDesc string)
func SendCreatedResponse ¶
func SendCreatedResponse(w http.ResponseWriter, object interface{})
func SendEmptyListResponse ¶
func SendEmptyListResponse(w http.ResponseWriter)
func SendInternalErrorResponse ¶
func SendInternalErrorResponse(w http.ResponseWriter, object interface{})
func SendOKResponse ¶
func SendOKResponse(w http.ResponseWriter, object interface{})
func SendPageNotFoundResponse ¶
func SendPageNotFoundResponse(w http.ResponseWriter)
func SendResponse ¶
func SendResponse(w http.ResponseWriter, statusCode int, object interface{})
func VerifyContentType ¶
VerifyContentType reads content type from HTTP header, if the content type can not be found in expectedContentTypes, write response with status 415 Unsupported Media Type and returns false.
Types ¶
Click to show internal directories.
Click to hide internal directories.