Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type Config ¶
这个对象维护整个程序配置
type MySQL ¶
type MySQL struct {
Host string `json:"host" toml:"host" env:"MYSQL_HOST"`
Port int `json:"port" toml:"port" env:"MYSQL_PORT"`
DB string `json:"database" toml:"database" env:"MYSQL_DB"`
Username string `json:"username" toml:"username" env:"MYSQL_USERNAME"`
Password string `json:"password" toml:"password" env:"MYSQL_PASSWORD"`
// contains filtered or unexported fields
}
func (*MySQL) DSN ¶
参考 https://github.com/go-sql-driver/mysql#dsn-data-source-name 获取详情 dsn := "user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local"
Source Files
¶
- config.go
- load.go
Click to show internal directories.
Click to hide internal directories.