Documentation ¶
Index ¶
Constants ¶
View Source
const (
MsecLocalTimeFormat = "2006-01-02 15:04:05.000"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CasbinConfiguration ¶
type CasbinConfiguration struct {
ModelPath string `mapstructure:"model-path" json:"modelPath"`
}
type Configuration ¶
type Configuration struct { Server *ServerConfiguration `mapstructure:"server" json:"server"` Mysql *MysqlConfiguration `mapstructure:"mysql" json:"mysql"` Redis *RedisConfiguration `mapstructure:"redis" json:"redis"` Casbin *CasbinConfiguration `mapstructure:"casbin" json:"casbin"` Jwt *JWTConfiguration `mapstructure:"jwt" json:"jwt"` Log *LogConfiguration `mapstructure:"log" json:"log"` }
viper内置了mapstructure, yml文件用"-"区分单词, 转为驼峰方便
type CustomConfBox ¶
自定义配置盒子,存放环境配置和对应的viper
type JWTConfiguration ¶
type LogConfiguration ¶
type LogConfiguration struct { Path string `mapstructure:"path" json:"path"` Level zapcore.Level `mapstructure:"level" json:"level"` MaxSize int `mapstructure:"max-size" json:"maxSize"` MaxAge int `mapstructure:"max-age" json:"maxAge"` MaxBackups int `mapstructure:"max-backups" json:"maxBackups"` Compress bool `mapstructure:"compress" json:"compress"` }
type MysqlConfiguration ¶
type MysqlConfiguration struct { Host string `mapstructure:"host" json:"host"` Username string `mapstructure:"username" json:"username"` Password string `mapstructure:"password" json:"password"` Database string `mapstructure:"database" json:"database"` MaxIdleConnections int `mapstructure:"max-idle-connections" json:"maxIdleConnections"` MaxOpenConnections int `mapstructure:"max-open-connections" json:"maxOpenConnections"` MaxConnectionLifeTime time.Duration `mapstructure:"max-connection-life-time" json:"maxConnectionLifeTime"` LogLevel int `mapstructure:"log-level" json:"logLevel"` }
type RedisConfiguration ¶
type ServerConfiguration ¶
type ServerConfiguration struct { Port int `mapstructure:"port" json:"port"` Name string `mapstructure:"name" json:"name"` UrlPrefix string `mapstructure:"url-prefix" json:"urlPrefix"` ApiVersion string `mapstructure:"api-version" json:"apiVersion"` InitData bool `mapstructure:"init-data" json:"initData"` IdempotenceTokenName string `mapstructure:"idempotence-token-name" json:"idempotenceTokenName"` }
Click to show internal directories.
Click to hide internal directories.