Documentation ¶
Index ¶
- Constants
- Variables
- func Config() *gorm.Config
- func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- func GetWriteSyncer(file string) zapcore.WriteSyncer
- func Gorm() *gorm.DB
- func GormMysql() *gorm.DB
- func NewWriter(w logger.Writer) *writer
- func PathExists(path string) (bool, error)
- func RedirectConfigFile(path string) string
- func Viper(path ...string) *viper.Viper
- func Zap() (logger *zap.Logger)
- type GVA_MODEL
Constants ¶
View Source
const ( ConfigEnv = "GVA_CONFIG" ConfigFile = "config.yaml" )
View Source
const MaxRedirectCount = 5
todo 提取为公共方法
Variables ¶
View Source
var ( GVA_DB *gorm.DB GVA_REDIS *redis.Client GVA_CONFIG config.Server GVA_VP *viper.Viper GVA_LOG *zap.Logger GVA_Timer = timer.NewTimerTask() GVA_Concurrency_Control = &singleflight.Group{} BlackCache local_cache.Cache Validate *validator.Validate )
Functions ¶
func Config ¶
Config gorm 自定义配置 Author [SliverHorn](https://github.com/SliverHorn)
func CustomTimeEncoder ¶
func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
自定义日志输出时间格式
func GetWriteSyncer ¶
func GetWriteSyncer(file string) zapcore.WriteSyncer
func GormMysql ¶
GormMysql 初始化Mysql数据库 Author [piexlmax](https://github.com/piexlmax) Author [SliverHorn](https://github.com/SliverHorn)
func NewWriter ¶
NewWriter writer 构造函数 Author [SliverHorn](https://github.com/SliverHorn)
func PathExists ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.