package
Version:
v1.1.1
Opens a new window with list of versions in this module.
Published: Sep 20, 2019
License: Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
func JSON(c *gin.Context, rc *retcode.RetCode, data interface{})
-
func JSON400(c *gin.Context, rc *retcode.RetCode, data interface{})
-
func JSON404(c *gin.Context, rc *retcode.RetCode, data interface{})
-
func JSON500(c *gin.Context, rc *retcode.RetCode, data interface{})
-
func Respond(c *gin.Context, status int, rc *retcode.RetCode, data interface{})
-
type Response
JSON respond unified JSON structure with 200 http status code
JSON400 respond unified JSON structure with 400 http status code
JSON404 respond unified JSON structure with 404 http status code
JSON500 respond unified JSON structure with 500 http status code
Respond encapsulates c.JSON
debug mode respond indented json
type Response struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data"`
}
Response the unified json structure
Source Files
¶
Click to show internal directories.
Click to hide internal directories.