app

package
v0.0.0-...-8e399c3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindJsonAndValid

func BindJsonAndValid(c *gin.Context, form interface{}) (int, int, error)

BindJsonAndValid BindAndValid binds and validates data

func BindJsonAndValid2

func BindJsonAndValid2(c *gin.Context, form interface{}, validatorFunc ...validator.Func) (int, int, error)

BindJsonAndValid2 BindAndValid binds and validates data

func MarkErrors

func MarkErrors(errors []*validation.Error)

MarkErrors logs error logs

func MarkErrors2

func MarkErrors2(errors []validator.FieldError)

Types

type Gin

type Gin struct {
	C *gin.Context
}

func (*Gin) Response

func (g *Gin) Response(httpCode, errCode int, data interface{})

Response setting gin.JSON

type Response

type Response struct {
	Code int         `json:"code,omitempty"`
	Msg  string      `json:"msg,omitempty"`
	Data interface{} `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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