handlers

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinHandler

func GinHandler(myHandler HandlerFuncResError) gin.HandlerFunc

func SystemHandler

func SystemHandler(err error)

Types

type HandlerFuncResError

type HandlerFuncResError func(*gin.Context) (Result, error)

type Result

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

func (*Result) UpdateAllFields

func (res *Result) UpdateAllFields(code int, msg string, data interface{}) *Result

func (*Result) UpdateDataField

func (res *Result) UpdateDataField(data interface{}) *Result

Jump to

Keyboard shortcuts

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