Documentation ¶
Index ¶
- Variables
- type AppConfig
- type AuthConfig
- type CacheConfig
- type Config
- func (c *Config) AddCloser(close func())
- func (c *Config) Close()
- func (c *Config) GetAuthToken() infraContract.AuthToken
- func (c *Config) GetCacheManager() contract.CacheManager
- func (c *Config) GetCrypto() contract.Crypto
- func (c *Config) GetDataManager() contract.DataManager
- func (c *Config) GetHttpPort() string
- func (c *Config) GetLogger() logger.Logger
- func (c *Config) GetMysqlDsn() string
- func (c *Config) GetTracer() trace.Tracer
- func (c *Config) GetValidator() validator.Validator
- type DBConfig
- type LogConfig
- type MySQLConfig
- type RedisConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var EnvKeyReplacer = strings.NewReplacer(".", "_", "-", "_")
EnvKeyReplacer replace for environment variable parse
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct { Name string `mapstructure:"name"` Environment string `mapstructure:"environment"` Port string `mapstructure:"port"` Auth AuthConfig `mapstructure:"auth"` }
type AuthConfig ¶
type CacheConfig ¶
type CacheConfig struct {
Redis RedisConfig `mapstructure:"redis"`
}
type Config ¶
type Config struct { App AppConfig `mapstructure:"app"` Cache CacheConfig `mapstructure:"cache"` DB DBConfig `mapstructure:"db"` Log LogConfig `mapstructure:"log"` // contains filtered or unexported fields }
func GetConfigEnvironment ¶
GetConfigEnvironment read config from environment variables and config.toml file
func (*Config) GetAuthToken ¶
func (c *Config) GetAuthToken() infraContract.AuthToken
GetAuthToken returns a new auth token or panics if it fails
func (*Config) GetCacheManager ¶
func (c *Config) GetCacheManager() contract.CacheManager
GetCacheManager returns a new cache manager or panics if it fails
func (*Config) GetDataManager ¶
func (c *Config) GetDataManager() contract.DataManager
GetDataManager returns a new data manager or panics if it fails
func (*Config) GetHttpPort ¶
func (*Config) GetMysqlDsn ¶
func (*Config) GetValidator ¶
GetValidator returns a new validator or panics if it fails
type DBConfig ¶
type DBConfig struct {
MySQL MySQLConfig `mapstructure:"mysql"`
}
type MySQLConfig ¶
type MySQLConfig struct { Username string `mapstructure:"username"` Password string `mapstructure:"password"` Host string `mapstructure:"host"` Port string `mapstructure:"port"` DBName string `mapstructure:"db-name"` MaxLifeInMinutes int `mapstructure:"max-life-in-minutes"` MaxIdleConnections int `mapstructure:"max-idle-connections"` MaxOpenConnections int `mapstructure:"max-open-connections"` }
Click to show internal directories.
Click to hide internal directories.