Documentation
¶
Index ¶
- func Addr() string
- func IsDev() bool
- func IsSingle() bool
- func Log() string
- func Mode() string
- func ReadConfigFile(configFile string) (bytes []byte, err error)
- func Register(c Config)
- func RegisterDefault()
- type Config
- type DbConfig
- type DefaultConfig
- func (c *DefaultConfig) GetAddr() string
- func (c *DefaultConfig) GetDb() DbConfig
- func (c *DefaultConfig) GetEnv() string
- func (c *DefaultConfig) GetLog() string
- func (c *DefaultConfig) GetMode() string
- func (c *DefaultConfig) GetNode() int
- func (c *DefaultConfig) IsDev() bool
- func (c *DefaultConfig) IsSingle() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadConfigFile ¶
func RegisterDefault ¶
func RegisterDefault()
Types ¶
type DbConfig ¶
type DbConfig struct { Host string `toml:"host"` Port int `toml:"port"` Username string `toml:"username"` Password string `toml:"password"` Dbname string `toml:"dbname"` Charset string `toml:"charset"` MaxOpenConn int `toml:"pool_max_open"` MaxIdleConn int `toml:"pool_max_idle"` MaxLifetime int `toml:"pool_max_life"` }
type DefaultConfig ¶
type DefaultConfig struct { Addr string `toml:"addr"` Env string `toml:"env"` Log string `toml:"log"` Db DbConfig `toml:"db"` Node int `toml:"node"` }
func (*DefaultConfig) GetAddr ¶
func (c *DefaultConfig) GetAddr() string
func (*DefaultConfig) GetDb ¶
func (c *DefaultConfig) GetDb() DbConfig
func (*DefaultConfig) GetEnv ¶
func (c *DefaultConfig) GetEnv() string
func (*DefaultConfig) GetLog ¶
func (c *DefaultConfig) GetLog() string
func (*DefaultConfig) GetMode ¶
func (c *DefaultConfig) GetMode() string
func (*DefaultConfig) GetNode ¶
func (c *DefaultConfig) GetNode() int
func (*DefaultConfig) IsDev ¶
func (c *DefaultConfig) IsDev() bool
func (*DefaultConfig) IsSingle ¶
func (c *DefaultConfig) IsSingle() bool
Click to show internal directories.
Click to hide internal directories.