rgrouter

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Validate = validator.New()

Functions

func Error

func Error(err error) (msg string, fields []string)

* @Content : 返回入参错误 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-04-15

func GetConfigHandle added in v1.0.15

func GetConfigHandle(ctx *gin.Context)

func GetLogLevelHandle added in v1.0.15

func GetLogLevelHandle(ctx *gin.Context)

func HeartBeatHandle

func HeartBeatHandle(ctx *gin.Context)

HeartBeatHandle 心跳 @Param : ctx *gin.Context @Return : @Author : LiJunDong @Time : 2022-06-18

func InitTrans

func InitTrans() (err error)

func NewRouter

func NewRouter() *gin.Engine

* @Content : 初始化路由 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-03-01

func RegisterFunc

func RegisterFunc(name string, f func(validator.FieldLevel) bool)

* @Content : 自定义验证方法 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-03-29

func RegisterMessage

func RegisterMessage(name string, param MessageTrans)

* @Content : 注册自定义错误语言 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-03-29

func Run

func Run(router *gin.Engine)

* @Content : 启动 * @Param : * @Return : * @Author : LiJunDong * @Time : 2022-05-21

func SetLogLevelHandle added in v1.0.15

func SetLogLevelHandle(ctx *gin.Context)

Types

type MessageTrans

type MessageTrans struct {
	RegisterFn    func(ut.Translator) error
	TranslationFn func(ut.Translator, validator.FieldError) string
}

Jump to

Keyboard shortcuts

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