Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var App = &AppConfig{ Name: config.GetString("app.name", "MIN"), Addr: config.GetString("app.addr", "127.0.0.1"), Port: config.GetInt("app.port", 3000), Debug: config.GetBool("app.debug", false), Locale: config.GetString("app.locale", "zh"), LangPath: "locales", }
View Source
var Cache = &CacheConfig{ Driver: "redis", Prefix: str.ToSnakeCase(App.Name) + ":cache:", Database: 1, }
View Source
var Database = &DatabaseConfig{ Driver: config.GetString("database.driver", "mysql"), Host: config.GetString("database.host", "127.0.0.1"), Port: config.GetInt("database.port", 3306), Database: config.GetString("database.database"), User: config.GetString("database.user"), Password: config.GetString("database.password"), Charset: config.GetString("database.charset", "utf8mb4"), Collation: config.GetString("database.collation", "utf8mb4_unicode_ci"), Timeout: config.GetString("database.timeout", "5s"), Debug: config.GetBool("database.debug", false), }
View Source
var Jwt = &JwtConfig{ SigningKey: "jwtClaims", Secret: config.GetString("jwt.secret"), TTL: time.Hour * 1, }
View Source
var Log = &LogConfig{ Driver: config.GetString("log.driver", "file"), Path: config.GetString("log.path", "logs/"+str.ToSnakeCase(App.Name)+".log"), Level: config.GetString("log.level", "info"), Daily: config.GetBool("log.daily", true), Days: config.GetInt("log.days", 15), }
View Source
var Redis = &RedisConfig{ Host: config.GetString("redis.host", "127.0.0.1"), Port: config.GetInt("redis.port", 6379), Password: config.GetString("redis.password", ""), Database: 0, }
Functions ¶
This section is empty.
Types ¶
type CacheConfig ¶
type DatabaseConfig ¶
type LogConfig ¶
type LogConfig struct { Driver string // Supports: "file" Path string Level string // Supports: "debug", "info", "warn", "error", "fatal" Daily bool // Supported driver: "file", Whether to generate a new log file every day Days int // Supported driver: "file", The number of days to keep the log file }
Click to show internal directories.
Click to hide internal directories.