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