Documentation
¶
Overview ¶
Package middleware provides functions to modify the context of a htttp request or response
Index ¶
- Constants
- func Database(context *apimodels.APIContext) *verrors.APIError
- func Request(r *http.Request, context *apimodels.APIContext) *verrors.APIError
- func Response(context *apimodels.APIContext, writer http.ResponseWriter)
- func Security(context *apimodels.APIContext) *verrors.APIError
- func SendResponse(w http.ResponseWriter, status int, response interface{}, ...)
- func Trazability(context *apimodels.APIContext) *verrors.APIError
- type EmptyResponse
- type Middleware
Constants ¶
View Source
const AuthorizationHeader = "Authorization"
View Source
const ContentTypeHeader = "Content-Type"
View Source
const UserAgentHeader = "User-Agent"
Variables ¶
This section is empty.
Functions ¶
func Response ¶
func Response(context *apimodels.APIContext, writer http.ResponseWriter)
Response handle middleware function
func SendResponse ¶
func SendResponse(w http.ResponseWriter, status int, response interface{}, contentType apimodels.MimeType)
SendResponse sens a HTTP response
func Trazability ¶
func Trazability(context *apimodels.APIContext) *verrors.APIError
Types ¶
type Middleware ¶
type Middleware func(context *apimodels.APIContext) *verrors.APIError
Click to show internal directories.
Click to hide internal directories.