Documentation
¶
Index ¶
- Variables
- func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- func GetWriteSyncer() (zapcore.WriteSyncer, error)
- func GormMysql() *gorm.DB
- func GormSqlite() *gorm.DB
- func InitConfig(tomlPath string)
- func InitConn() *gorm.DB
- func InitRedis()
- func InitZap() (logger *zap.Logger)
- type DBConf
- type RedisConf
- type SettingConf
- type ZapLogConf
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Conf = &conf{}
)
Functions ¶
func CustomTimeEncoder ¶
func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
自定义日志输出时间格式
func GetWriteSyncer ¶
func GetWriteSyncer() (zapcore.WriteSyncer, error)
func GormSqlite ¶
func InitConfig ¶
func InitConfig(tomlPath string)
Types ¶
type SettingConf ¶
type ZapLogConf ¶
type ZapLogConf struct {
Level string `json:"level" yaml:"level"`
Format string ` json:"format" yaml:"format"`
Prefix string ` json:"prefix" yaml:"prefix"`
Director string ` json:"director" yaml:"director"`
LinkName string ` json:"linkName" yaml:"link-name"`
ShowLine bool ` json:"showLine" yaml:"showLine"`
EncodeLevel string ` json:"encodeLevel" yaml:"encode-level"`
StacktraceKey string `json:"stacktraceKey" yaml:"stacktrace-key"`
LogInConsole bool `json:"logInConsole" yaml:"log-in-console"`
}
Click to show internal directories.
Click to hide internal directories.