|
|
@ -6,24 +6,24 @@ import ( |
|
|
|
"github.com/kelseyhightower/envconfig" |
|
|
|
"github.com/kelseyhightower/envconfig" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
type DbConfig struct { |
|
|
|
type dbConfig struct { |
|
|
|
Host string `envconfig:"DB_HOST"` |
|
|
|
Host string `envconfig:"DB_HOST"` |
|
|
|
Port int `envconfig:"DB_PORT"` |
|
|
|
Port int `envconfig:"DB_PORT"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type AppConfig struct { |
|
|
|
type appConfig struct { |
|
|
|
Port int `envconfig:"APP_PORT"` |
|
|
|
Port int `envconfig:"APP_PORT"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type SentryConfig struct { |
|
|
|
type sentryConfig struct { |
|
|
|
DSN string `envconfig:"SENTRY_DSN"` |
|
|
|
DSN string `envconfig:"SENTRY_DSN"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ...
|
|
|
|
// ...
|
|
|
|
type Config struct { |
|
|
|
type Config struct { |
|
|
|
Db DbConfig |
|
|
|
Db dbConfig |
|
|
|
App AppConfig |
|
|
|
App appConfig |
|
|
|
Sentry SentryConfig |
|
|
|
Sentry sentryConfig |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func NewConfig() *Config { |
|
|
|
func NewConfig() *Config { |
|
|
|