common

package
v0.0.0-...-a3e8f81 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorResp

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

func GetRealIP

func GetRealIP(c *gin.Context) string

func HandleRecovery

func HandleRecovery(c *gin.Context, err any)

func ParamsErrorResp

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

func SuccessResp

func SuccessResp(c *gin.Context, data any)

func WrapResp

func WrapResp(c *gin.Context) func(data any, err error)

Types

type Resp

type Resp struct {
	Code    int    `json:"code"`
	Message string `json:"msg"`
	Data    any    `json:"data"`
}

func NewResp

func NewResp(data interface{}, err error) (int, *Resp)

Jump to

Keyboard shortcuts

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