agecem-org/pkg/agecemorg/config.go
Victor Lacasse-Beaudoin 7d4a747774 refactor: déplacer fichiers go source vers pkg/ et cmd/
Déplacer public/ et templates/ vers ui/ et ui/public/

Bump projet à v3, API toujours v1
2024-09-27 20:25:12 -04:00

41 lines
1.3 KiB
Go

package agecemorg
/*
Permet de contenir la configuration obtenue par cobra/viper
Example d'utilisation sans error handling:
```
var cfg 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 {
Auth bool `mapstructure:"auth"`
Password string `mapstructure:"password"`
Username string `mapstructure:"username"`
} `mapstructure:"admin"`
Api struct {
Auth bool `mapstructure:"auth"`
Host string `mapstructure:"host"`
Key string `mapstructure:"key"`
Port int `mapstructure:"port"`
Protocol string `mapstructure:"protocol"`
} `mapstructure:"api"`
Documents struct {
AccessKeyId string `mapstructure:"access_key_id"`
Buckets map[string]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"`
}