Remplacer struct tags json -> mapstructure

Fix problèmes de config à s'attendre à du PascalCase au lieu du intended
snake_case
This commit is contained in:
Victor Lacasse-Beaudoin 2023-07-04 18:39:00 -04:00
parent 6352224b01
commit aaf8521984

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"`
} }