Documentation ¶
Index ¶
Constants ¶
View Source
const ( TextFormat = LogFormat("text") JSONFormat = LogFormat("json") )
View Source
const ( ToFile = LogTo("file") ToStdout = LogTo("stdout") )
View Source
const AppservicesPath = "/Users/chartte/go/src/mage/restful-api-demo/etc/appservice.json"
View Source
const GlobalConfig = "/Users/chartte/go/src/mage/restful-api-demo/etc/demo.toml"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct { Name string `toml:"name" env:"APP_NAME"` Host string `toml:"host" env:"APP_HOST"` Port string `toml:"port" env:"APP_PORT"` Key string `toml:"key" env:"APP_KEY"` }
func NewDefaultApp ¶
func NewDefaultApp() *App
type Log ¶
type Log struct { Level string `toml:"level" env:"LOG_LEVEL"` PathDir string `toml:"path_dir" env:"LOG_PATH_DIR"` Format LogFormat `toml:"format" env:"LOG_FORMAT"` To LogTo `toml:"to" env:"LOG_TO"` }
func NewDefaultLog ¶
func NewDefaultLog() *Log
type MySQL ¶
type MySQL struct { Host string `toml:"host" env:"MYSQL_HOST"` Port string `toml:"port" env:"MYSQL_PORT"` UserName string `toml:"username" env:"MYSQL_USERNAME"` Password string `toml:"password" env:"MYSQL_PASSWORD"` Database string `toml:"database" env:"MYSQL_DATABASE"` MaxOpenConn int `toml:"max_open_conn" env:"MYSQL_MAX_OPEN_CONN"` MaxIdleConn int `toml:"max_idle_conn" env:"MYSQL_MAX_IDLE_CONN"` MaxLifeTime int `toml:"max_life_time" env:"MYSQL_MAX_LIFE_TIME"` MaxIdleTime int `toml:"max_idle_time" env:"MYSQL_MAX_idle_TIME"` }
func NewDefaultMySQL ¶
func NewDefaultMySQL() *MySQL
type ServiceConfig ¶
type ServiceConfig struct {
Services []ServiceInfo
}
type ServiceInfo ¶
Click to show internal directories.
Click to hide internal directories.