response

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(c *gin.Context, rc *retcode.RetCode, data interface{})

JSON respond unified JSON structure with 200 http status code

func JSON400

func JSON400(c *gin.Context, rc *retcode.RetCode, data interface{})

JSON400 respond unified JSON structure with 400 http status code

func JSON404

func JSON404(c *gin.Context, rc *retcode.RetCode, data interface{})

JSON404 respond unified JSON structure with 404 http status code

func JSON500

func JSON500(c *gin.Context, rc *retcode.RetCode, data interface{})

JSON500 respond unified JSON structure with 500 http status code

func Respond

func Respond(c *gin.Context, status int, rc *retcode.RetCode, data interface{})

Respond encapsulates c.JSON debug mode respond indented json

Types

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

Response the unified json structure

Jump to

Keyboard shortcuts

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