3
0

Add MinIO support

This commit is contained in:
Denis Arh
2019-10-15 13:22:57 +02:00
parent e754a2fe0b
commit aa469e53e9
7 changed files with 226 additions and 2 deletions

View File

@@ -3,12 +3,26 @@ package options
type (
StorageOpt struct {
Path string `env:"STORAGE_PATH"`
MinioEndpoint string `env:"MINIO_ENDPOINT"`
MinioSecure bool `env:"MINIO_SECURE"`
MinioAccessKey string `env:"MINIO_ACCESS_KEY"`
MinioSecretKey string `env:"MINIO_SECRET_KEY"`
MinioBucket string `env:"MINIO_BUCKET"`
MinioStrict bool `env:"MINIO_STRICT"`
}
)
func Storage(pfix string) (o *StorageOpt) {
o = &StorageOpt{
Path: "var/store",
// Make minio secure by default
MinioSecure: true,
// Run in struct mode:
// - do not create unexisting buckets
MinioStrict: false,
}
fill(o, pfix)