42 lines
1.1 KiB
Go
42 lines
1.1 KiB
Go
package config
|
|
|
|
type RobotFSConfig struct {
|
|
Address string `mapstructure:"address"`
|
|
LogPath string `mapstructure:"log_path"`
|
|
}
|
|
|
|
type RedisConfig struct {
|
|
Address string `mapstructure:"address"`
|
|
Password string `mapstructure:"password"`
|
|
DataBase int `mapstructure:"database"`
|
|
//Todo: use it in the future
|
|
SuperLargeDirectories []string `mapstructure:"superLargeDirectories"`
|
|
}
|
|
|
|
type S3Config struct {
|
|
Region string `mapstructure:"region"`
|
|
Endpoint string `mapstructure:"endpoint"`
|
|
AccessKeyID string `mapstructure:"access_key_id"`
|
|
SecretAccessKey string `mapstructure:"secret_access_key"`
|
|
BucketName string `mapstructure:"bucket_name"`
|
|
UsePathStyle bool `mapstructure:"use_path_style"`
|
|
}
|
|
|
|
type JuicefsConfig struct {
|
|
//Address string `mapstructure:"address"`
|
|
DataPath string `mapstructure:"data_path"`
|
|
}
|
|
|
|
type Config struct {
|
|
RobotFS RobotFSConfig `mapstructure:"robotfs"`
|
|
Redis RedisConfig `mapstructure:"redis"`
|
|
S3 S3Config `mapstructure:"s3"`
|
|
Juicefs JuicefsConfig `mapstructure:"juicefs"`
|
|
}
|
|
|
|
func GetConfig() *Config {
|
|
config := &Config{}
|
|
|
|
return config
|
|
}
|