res

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: MIT, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthOverdueRes

func AuthOverdueRes(c *gin.Context)

func CommonRes

func CommonRes(c *gin.Context, status Status, msg string, data interface{})

func FailureRes

func FailureRes(c *gin.Context, err error)

func NoPermissionRes

func NoPermissionRes(c *gin.Context)

func ParamCheckRes

func ParamCheckRes(c *gin.Context, err error)

func SuccessRes

func SuccessRes(c *gin.Context, data interface{})

func SystemErrorRes

func SystemErrorRes(c *gin.Context, err error)

Types

type Response

type Response struct {
	Status Status      `json:"status"`
	Msg    interface{} `json:"msg"`
	Data   interface{} `json:"data"`
}

type Status

type Status string
const (
	Success      Status = "success"
	Failure      Status = "failure"
	ParamCheck   Status = "param check"
	AuthOverdue  Status = "auth overdue"
	NoPermission Status = "no permission"
	SystemError  Status = "system error"
)

Jump to

Keyboard shortcuts

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