Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Conf = config{} ConfViper = viper.New() )
Functions ¶
Types ¶
type DB ¶
type DB struct { // 数据库驱动 DriverName string `json:"driverName" toml:"driverName"` // 数据库用户名 Username string `json:"username" toml:"username"` // 数据库密码 Password string `json:"password" toml:"password"` // 数据库服务器地址 Host string `json:"host" toml:"host"` // 数据库服务器端口 Port int `json:"port" toml:"port"` // 数据库名称 Dbname string `json:"dbname" toml:"dbname"` // 数据库其他配置 Config string `json:"config" toml:"config"` // 数据库最大空闲连接数 MaxIdleConns int `json:"maxIdleConns" toml:"maxIdleConns"` // 数据库最大连接数 MaxOpenConns int `json:"maxOpenConns" toml:"maxOpenConns"` // 是否开启Gorm全局日志 LogMode bool `json:"logMode" toml:"logMode"` }
DB 数据源
type Lumberjack ¶
type Lumberjack struct { // 每个日志文件保存10M,默认 100M MaxSize int `json:"maxSize" toml:"maxSize"` // 保留30个备份,默认不限 MaxBackups int `json:"maxBackups" toml:"maxBackups"` // 保留7天,默认不限 MaxAge int `json:"maxAge" toml:"maxAge"` // 是否压缩,默认不压缩 Compress bool `json:"compress" toml:"compress"` //使用计算机时间作为备份时间 LocalTime bool `json:"localTime" toml:"localTime"` }
type SnowFlake ¶
type SnowFlake struct { // 雪花算法工作站id WorkerId int64 `json:"workerId" toml:"workerId""` }
type SuperAdmin ¶
type Zap ¶
type Zap struct { // 级别 Level string `json:"level" toml:"level"` // 输出格式,json/console可选 Format string `json:"format" toml:"format"` // 日志前缀 Prefix string `json:"prefix" toml:"prefix"` // 日志文件夹 Directory string `json:"directory" toml:"directory"` // 软链接名称 LinkName string `json:"linkName" toml:"linkName"` // 显示行 ShowLine bool `json:"showLine" toml:"showLine"` // 编码器选择 EncodeLevel string `json:"encodeLevel" toml:"encodeLevel"` // 栈名 StacktraceKey string `json:"stacktraceKey" toml:"stacktraceKey"` // 输出控制台 LogInConsole bool `json:"logInConsole" toml:"logInConsole"` // 日志切割 Lumberjack Lumberjack `json:"lumberjack" toml:"lumberjack"` }
Zap zap日志
Click to show internal directories.
Click to hide internal directories.