Documentation ¶
Index ¶
- func CurrentPage(ctx *gin.Context) int
- func CurrentSize(ctx *gin.Context) int
- func Page(db *gorm.DB, pageNum int) *gorm.DB
- func PageWithSize(db *gorm.DB, pageNum, pageSize int) *gorm.DB
- func Params(ctx *gin.Context) map[string]string
- func QueryToMap(query url.Values) map[string]string
- func RequestString(c *gin.Context) string
- type APIError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentPage ¶
CurrentPage returns the current paginate page number, returns 1 as default
func CurrentSize ¶
func Params ¶
Params returns the request's all params as map[string]interface{} 1. Query Params (All String) 2. Body Params 3. Form Params 4. URL Params
func QueryToMap ¶
QueryToMap makes url query params to map[string]string eg:
url: https://yourdomain?a=a&b=b returns:
map[string]string{ "a": "a", "b": "b", }
func RequestString ¶
RequestString provide a method to generate request info.
We can use it with type APIError's Request attribute eg: GET: /home
Types ¶
Click to show internal directories.
Click to hide internal directories.