2023-07-04 14:15:36 -04:00
|
|
|
package config
|
|
|
|
|
|
|
|
/*
|
|
|
|
Permet de contenir la configuration obtenue par cobra/viper
|
|
|
|
|
|
|
|
Example d'utilisation sans error handling:
|
|
|
|
|
|
|
|
```
|
|
|
|
var cfg config.Config
|
|
|
|
viper.Unmarshal(&cfg)
|
|
|
|
```
|
|
|
|
|
|
|
|
`cfg` devrait alors contenir la configuration, et les données peuvent être
|
|
|
|
obtenues simplement en utilisant la dot (.) notation
|
|
|
|
*/
|
|
|
|
type Config struct {
|
|
|
|
Server struct {
|
|
|
|
Admin struct {
|
2023-07-04 18:39:00 -04:00
|
|
|
Auth bool `mapstructure:"auth"`
|
|
|
|
Password string `mapstructure:"password"`
|
|
|
|
Username string `mapstructure:"username"`
|
|
|
|
} `mapstructure:"admin"`
|
2023-07-04 14:15:36 -04:00
|
|
|
Api struct {
|
2023-07-04 18:39:00 -04:00
|
|
|
Auth bool `mapstructure:"auth"`
|
|
|
|
Key string `mapstructure:"key"`
|
|
|
|
} `mapstructure:"api"`
|
2023-07-04 14:15:36 -04:00
|
|
|
Documents struct {
|
2023-07-04 18:39:00 -04:00
|
|
|
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"`
|
2023-07-04 14:15:36 -04:00
|
|
|
}
|