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 { type Config struct {
Server struct { Server struct {
Admin struct { Admin struct {
Auth bool `json:"auth"` Auth bool `mapstructure:"auth"`
Password string `json:"password"` Password string `mapstructure:"password"`
Username string `json:"username"` Username string `mapstructure:"username"`
} `json:"admin"` } `mapstructure:"admin"`
Api struct { Api struct {
Auth bool `json:"auth"` Auth bool `mapstructure:"auth"`
Key string `json:"key"` Key string `mapstructure:"key"`
} `json:"api"` } `mapstructure:"api"`
Documents struct { Documents struct {
AccessKeyId string `json:"access_key_id"` AccessKeyId string `mapstructure:"access_key_id"`
Buckets []string `json:"buckets"` Buckets []string `mapstructure:"buckets"`
Endpoint string `json:"endpoint"` Endpoint string `mapstructure:"endpoint"`
SecretAccessKey string `json:"secret_access_key"` SecretAccessKey string `mapstructure:"secret_access_key"`
UseSSL bool `json:"use_ssl"` UseSSL bool `mapstructure:"use_ssl"`
} `json:"documents"` KeyId string `mapstructure:"keyid"`
Port int `json:"port"` KeyValue string `mapstructure:"keyvalue"`
} `json:"server"` } `mapstructure:"documents"`
Port int `mapstructure:"port"`
} `mapstructure:"server"`
} }