media storage config + env
This commit is contained in:
parent
262d02e915
commit
e708c92d18
3 changed files with 39 additions and 6 deletions
|
|
@ -3,10 +3,11 @@ package config
|
|||
import "strings"
|
||||
|
||||
type Config struct {
|
||||
AppConf AppConfig
|
||||
DBConf DatabaseConfig
|
||||
JWTConf JWTConfig
|
||||
GrpcConf GrpcConfig
|
||||
AppConf AppConfig
|
||||
DBConf DatabaseConfig
|
||||
JWTConf JWTConfig
|
||||
GrpcConf GrpcConfig
|
||||
MediaConf MediaConfig
|
||||
}
|
||||
|
||||
type AppConfig struct {
|
||||
|
|
@ -40,6 +41,13 @@ type GrpcConfig struct {
|
|||
GrpcClientPort string
|
||||
}
|
||||
|
||||
type MediaConfig struct {
|
||||
Host string
|
||||
Port string
|
||||
User string
|
||||
Password string
|
||||
}
|
||||
|
||||
func NewConfig() *Config {
|
||||
return &Config{
|
||||
AppConf: AppConfig{
|
||||
|
|
@ -72,5 +80,12 @@ func NewConfig() *Config {
|
|||
GrpcServerPort: getEnv("GRPC_SERVER_PORT", ""),
|
||||
GrpcClientPort: getEnv("GRPC_CLIENT_PORT", ""),
|
||||
},
|
||||
|
||||
MediaConf: MediaConfig{
|
||||
Host: getEnv("MEDIA_STORAGE_HOST", ""),
|
||||
Port: getEnv("MEDIA_STORAGE_PORT", ""),
|
||||
User: getEnv("MEDIA_STORAGE_USER", ""),
|
||||
Password: getEnv("MEDIA_STORAGE_PASSWORD", ""),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue