Documentation ¶
Index ¶
- Variables
- func MustLoad(path string)
- func PrintWithJSON()
- type CORS
- type Captcha
- type Casbin
- type Config
- type GZIP
- type Generate
- type Gorm
- type JWTAuth
- type Log
- type LogGormHook
- type LogHook
- type Monitor
- type MySQL
- type MySQLs
- type OSS
- type Postgres
- type Postgress
- type RateLimiter
- type Redis
- type Server
- type Sqlite3
- type Sqlite3s
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 EnableDP bool WWW string Version string Swagger bool PrintConfig bool Solt string AESKey string Server Server Casbin Casbin Log Log LogGormHook LogGormHook JWTAuth JWTAuth Monitor Monitor Captcha Captcha RateLimiter RateLimiter CORS CORS GZIP GZIP Redis Redis Gorm Gorm MySQLs MySQLs Postgress Postgress Sqlite3s Sqlite3s Generate Generate Oss OSS }
Config 配置参数
type Gorm ¶
type Gorm struct { Debug bool DBType string MaxLifetime int MaxOpenConns int MaxIdleConns int TablePrefix string EnableAutoMigrate bool }
Gorm gorm配置参数
type JWTAuth ¶
type JWTAuth struct { Enable bool SigningMethod string SigningKey string Expired int Store string FilePath string RedisDB int RedisPrefix string ExcludePaths []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 日志钩子配置
type MySQL ¶
type MySQL struct { Host string Port int User string Password string DBName string Parameters string }
MySQL mysql配置参数
type OSS ¶
type OSS struct { Enable bool Type string // 支持类型minio、aliyun、huawei、local; local:本地文件存储 Endpoint string AccessKeyID string SecretAccessKey string BucketName string ObjectNameFormat string SecurityToken string // 仅对华为OBS需要 StorageRoot string // 仅对本地(local)文件存储需要 CDN string }
OSS oss存储
type Postgres ¶
type Postgres struct { Host string Port int User string Password string DBName string SSLMode string }
Postgres postgres配置参数
type RateLimiter ¶
RateLimiter 请求频率限制配置参数
type Server ¶
type Server struct { Host string Port int CertFile string KeyFile string ShutdownTimeout int MaxContentLength int64 MaxLoggerLength int }
Server Server配置参数
Click to show internal directories.
Click to hide internal directories.