Documentation ¶
Index ¶
- Variables
- func InitConfig(configPath, configType, configToken, configKvPath, configRemoteType string)
- func InitGorm() (*gorm.DB, map[string]*gorm.DB)
- func InitRedisClient() (*redis.Client, error)
- func InitZap()
- type Logger
- func (l Logger) Error(ctx context.Context, str string, args ...interface{})
- func (l Logger) Info(ctx context.Context, str string, args ...interface{})
- func (l Logger) LogMode(level gormlogger.LogLevel) gormlogger.Interface
- func (l Logger) SetAsDefault()
- func (l Logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l Logger) Warn(ctx context.Context, str string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var Enforcer *casbin.Enforcer
Functions ¶
func InitConfig ¶
func InitConfig(configPath, configType, configToken, configKvPath, configRemoteType string)
InitConfig 初始化config
Types ¶
type Logger ¶
type Logger struct { ZapLogger *zap.Logger LogLevel gormlogger.LogLevel SlowThreshold time.Duration SkipCallerLookup bool IgnoreRecordNotFoundError bool }
Logger gorm使用zap作为logging
func (Logger) LogMode ¶
func (l Logger) LogMode(level gormlogger.LogLevel) gormlogger.Interface
func (Logger) SetAsDefault ¶
func (l Logger) SetAsDefault()
Click to show internal directories.
Click to hide internal directories.