Documentation ¶
Overview ¶
Package global @Description: 全局实例
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MysqlDb *gorm.DB // mysql数据库实例 PostgresDb *gorm.DB // postgre数据库实例 Redis *redis.Client // redis内存数据库实例 Validator *Validate // 结构体验证器 Casbin *casbin.SyncedEnforcer // Casbin策略服务 Vp *viper.Viper // 命令行处理实例 Log *zap.Logger // 日志实例 Config config.Server // 程序配置 Route *gin.Engine // 程序路由组 )
Functions ¶
This section is empty.
Types ¶
type Validate ¶
type Validate struct { Validate *validator.Validate // 验证器引用 Trans *ut.Translator // 汉化器引用 }
func (*Validate) FormatError ¶
FormatError
@Description: 格式化错误信息 @receiver v @param err @return error
func (*Validate) ValidateStruct ¶
ValidateStruct
@Description: 验证结构体 @receiver v @param u @return error
Click to show internal directories.
Click to hide internal directories.