initial
This commit is contained in:
commit
6a9de539ce
9 changed files with 277 additions and 0 deletions
36
config/config.go
Normal file
36
config/config.go
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package config
|
||||
|
||||
type Config struct {
|
||||
App AppConfig
|
||||
Rabbit RabbitMQConfig
|
||||
}
|
||||
|
||||
type AppConfig struct {
|
||||
Mode string
|
||||
LogLvl string
|
||||
}
|
||||
|
||||
type RabbitMQConfig struct {
|
||||
Host string
|
||||
Port uint16
|
||||
User string
|
||||
Pass string
|
||||
Vhost string
|
||||
}
|
||||
|
||||
func New() *Config {
|
||||
return &Config{
|
||||
App: AppConfig{
|
||||
Mode: getEnv("APP_MODE", "dev"),
|
||||
LogLvl: getEnv("APP_LOG_LVL", "debug"),
|
||||
},
|
||||
|
||||
Rabbit: RabbitMQConfig{
|
||||
Host: getEnv("RABBIT_HOST", "10.0.0.4"),
|
||||
Port: getEnvPort("RABBIT_PORT", 5672),
|
||||
User: getEnv("RABBIT_USER", "parser-mandarake-dev"),
|
||||
Pass: getEnv("RABBIT_PASS", "dev-pass"),
|
||||
Vhost: getEnv("RABBIT_VHOST", "taskProcessorDevHost"),
|
||||
},
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue