Documentation
¶
Index ¶
- Variables
- func MustLoad(fpaths ...string)
- func PrintWithJSON()
- type CORS
- type Captcha
- type Casbin
- type Config
- type GZIP
- type Gorm
- type HTTP
- type JWTAuth
- type Log
- type LogGormHook
- type LogHook
- type LogMongoHook
- type Menu
- type Mongo
- type Monitor
- type MySQL
- type Postgres
- type RateLimiter
- type Redis
- type Root
- type Sqlite3
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // C 全局配置(需要先执行MustLoad,否则拿不到配置) C = new(Config) )
Functions ¶
Types ¶
type CORS ¶
type CORS struct {
Enable bool
AllowOrigins []string
AllowMethods []string
AllowHeaders []string
AllowCredentials bool
MaxAge int
}
CORS 跨域请求配置参数
type Config ¶
type Config struct {
RunMode string
Static string
Swagger bool
PrintConfig bool
HTTP HTTP
Menu Menu
Casbin Casbin
Log Log
LogGormHook LogGormHook
LogMongoHook LogMongoHook
Root Root
JWTAuth JWTAuth
Monitor Monitor
Captcha Captcha
RateLimiter RateLimiter
CORS CORS
GZIP GZIP
Redis Redis
Gorm Gorm
MySQL MySQL
Postgres Postgres
Sqlite3 Sqlite3
Mongo Mongo
UniqueID struct {
Type string
Snowflake struct {
Node int64
Epoch int64
}
}
}
Config 配置参数
type Gorm ¶
type Gorm struct {
Debug bool
DBType string
MaxLifetime int
MaxOpenConns int
MaxIdleConns int
TablePrefix string
EnableAutoMigrate bool
}
Gorm gorm配置参数
type HTTP ¶
type HTTP struct {
Host string
Port int
CertFile string
KeyFile string
ShutdownTimeout int
MaxContentLength int64
}
HTTP http配置参数
type JWTAuth ¶
type JWTAuth struct {
Enable bool
SigningMethod string
SigningKey string
Expired int
Store string
FilePath string
RedisDB int
RedisPrefix string
}
JWTAuth 用户认证
type Log ¶
type Log struct {
Level int
Format string
Output string
OutputFile string
EnableHook bool
HookLevels []string
Hook LogHook
HookMaxThread int
HookMaxBuffer int
}
Log 日志配置参数
type LogGormHook ¶
type LogGormHook struct {
DBType string
MaxLifetime int
MaxOpenConns int
MaxIdleConns int
Table string
}
LogGormHook 日志gorm钩子配置
type MySQL ¶
type MySQL struct {
Host string
Port int
User string
Password string
DBName string
Parameters string
}
MySQL mysql配置参数
type Postgres ¶
type Postgres struct {
Host string
Port int
User string
Password string
DBName string
SSLMode string
}
Postgres postgres配置参数
type RateLimiter ¶
RateLimiter 请求频率限制配置参数
Click to show internal directories.
Click to hide internal directories.