This commit is contained in:
parent
7c45234c95
commit
270cc77d31
4 changed files with 104 additions and 4 deletions
|
|
@ -3,8 +3,9 @@ package config
|
|||
import "runtime"
|
||||
|
||||
type Config struct {
|
||||
App AppConfig
|
||||
Rabbit RabbitMQConfig
|
||||
App AppConfig
|
||||
Rabbit RabbitMQConfig
|
||||
Metrics MetricsConfig
|
||||
}
|
||||
|
||||
type AppConfig struct {
|
||||
|
|
@ -27,6 +28,12 @@ type RabbitMQConfig struct {
|
|||
TaskResultQueue string
|
||||
}
|
||||
|
||||
type MetricsConfig struct {
|
||||
Host string
|
||||
Port string
|
||||
GinMode string
|
||||
}
|
||||
|
||||
func New() *Config {
|
||||
return &Config{
|
||||
App: AppConfig{
|
||||
|
|
@ -48,5 +55,11 @@ func New() *Config {
|
|||
TaskSourceQueue: getEnv("TASK_SOURCE_QUEUE", "task-publisher-mandarake"),
|
||||
TaskResultQueue: getEnv("TASK_RESULT_QUEUE", "tasks-results"),
|
||||
},
|
||||
|
||||
Metrics: MetricsConfig{
|
||||
Host: getEnv("METRICS_HOST", "0.0.0.0"),
|
||||
Port: getEnv("METRICS_PORT", "19080"),
|
||||
GinMode: getEnv("METRICS_GIN_MODE", "dev"),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue