package
3.15.0+incompatible
Repository: https://github.com/crosserclaws/owl-backend.git
Documentation: pkg.go.dev

# Packages

A MVC binder for free-style of function handler with *gin.Context Abstract There are may tedious processes for coding on web service: 1.

# Functions

Binds JSON and panic with JsonBindError if there is error.
Builds a gin.HandlerFunc, which is used to handle not-nil object of panic.
Conforms the object and then validates the object, if any error occurs, panic with validation error.
Process various of panic object with corresponding HTTP status ValidationError - Use http.StatusBadRequest as output status BindJsonError - Use http.StatusBadRequest as output status Otherwise, use http.StatusInternalServerError as output status.
HeaderWithPaging would set headers with information of paging.
Output http.StatusConflict as JSON.
Output http.StatusMethodNotAllowed as JSON; { "http_status": 405, "error_code": -1, "method": c.Request.Method, "uri": c.Request.RequestURI, }.
Output http.StatusNotFound as JSON; { "http_status": 404, "error_code": -1, "uri": c.Request.RequestURI, }.
Initialize a router with default JSON response 1.
NewQueryWrapper converts *gin.Context to *QueryWrapper.
Output JSON if the checkedObject is not nil.
PagingByHeader would initialize paging object by header This funcion would load header value: "page-size" - The size of page "page-pos" - The position of page, starting with "1" "order-by" - The order for paging <prop_1>#<dir>:<prop_2>#<dir>:...
No description provided by the author
Try to start the engine with configuration of gin If some error happened, exit application with "os.Exit(1)".

# Structs

Defines the error while binding json.
Defines the error used to represent the "409 Conflict" error Usage Case 1: The conflict of unique key on a new or modified data Case 2: The conflict of complex logical of business on modified data HTTP Specification Following paragraph comes from RFC-2616(HTTP/1.1) The request could not be completed due to a conflict with the current state of the resource.
Configuration defines the properties on gin framework.
Used to be handled globally.
ViableParamValue defines the value of param and whether or not the value is viable In order to indicate the value of parameter of bool, integer..

# Type aliases

This callback function is used to process panic object.
QueryWrapper for gin.Context You may like to use "gin/mvc" framework instead of this utility to convert data by yourself.