Ajouter objet Config pour viper.Unmarshal() #63
1 changed files with 17 additions and 15 deletions
|
@ -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"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue