utils

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContentType

func GetContentType(content []byte) string

func GetNamespace

func GetNamespace(request *restful.Request) string

func RespondError

func RespondError(response *restful.Response, err error, statusCode int)

RespondError - logs and writes an error response with a desired status code

func RespondErrorMessage

func RespondErrorMessage(response *restful.Response, message string, statusCode int)

RespondErrorMessage - logs and writes an error message with a desired status code

func RespondMessageAndLogError

func RespondMessageAndLogError(response *restful.Response, err error, message string, statusCode int)

RespondMessageAndLogError - logs and writes an error message with a desired status code and logs the error

func WriteResponseLocation

func WriteResponseLocation(request *restful.Request, response *restful.Response, identifier string)

Write Content-Location header within POST methods and set StatusCode to 201 Headers MUST be set before writing to body (if any) to succeed

Types

This section is empty.

Jump to

Keyboard shortcuts

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