Ajouter objet Config pour viper.Unmarshal() #63

Merged
vlbeaudoin merged 9 commits from feature/viper-config-object into main 2023-07-04 20:06:01 -04:00
Showing only changes of commit aaf8521984 - Show all commits

View file

@ -16,21 +16,23 @@ obtenues simplement en utilisant la dot (.) notation
type Config struct {
Server struct {
Admin struct {
Auth bool `json:"auth"`
Password string `json:"password"`
Username string `json:"username"`
} `json:"admin"`
Auth bool `mapstructure:"auth"`
Password string `mapstructure:"password"`
Username string `mapstructure:"username"`
} `mapstructure:"admin"`
Api struct {
Auth bool `json:"auth"`
Key string `json:"key"`
} `json:"api"`
Auth bool `mapstructure:"auth"`
Key string `mapstructure:"key"`
} `mapstructure:"api"`
Documents struct {
AccessKeyId string `json:"access_key_id"`
Buckets []string `json:"buckets"`
Endpoint string `json:"endpoint"`
SecretAccessKey string `json:"secret_access_key"`
UseSSL bool `json:"use_ssl"`
} `json:"documents"`
Port int `json:"port"`
} `json:"server"`
AccessKeyId string `mapstructure:"access_key_id"`
Buckets []string `mapstructure:"buckets"`
Endpoint string `mapstructure:"endpoint"`
SecretAccessKey string `mapstructure:"secret_access_key"`
UseSSL bool `mapstructure:"use_ssl"`
KeyId string `mapstructure:"keyid"`
KeyValue string `mapstructure:"keyvalue"`
} `mapstructure:"documents"`
Port int `mapstructure:"port"`
} `mapstructure:"server"`
}