28 lines
1.1 KiB
Go
28 lines
1.1 KiB
Go
|
|
package minio
|
||
|
|
|
||
|
|
import "net/http"
|
||
|
|
|
||
|
|
// Config holds MinIO connection settings. Required fields must be supplied
|
||
|
|
// by the caller; optional fields have production-safe defaults via DefaultConfig.
|
||
|
|
type Config struct {
|
||
|
|
Endpoint string `env:"EINHERJAR_MINIO_ENDPOINT,required"`
|
||
|
|
AccessKey string `env:"EINHERJAR_MINIO_ACCESS_KEY,required"`
|
||
|
|
SecretKey string `env:"EINHERJAR_MINIO_SECRET_KEY,required"`
|
||
|
|
UseSSL bool `env:"EINHERJAR_MINIO_USE_SSL" envDefault:"false"`
|
||
|
|
Bucket string `env:"EINHERJAR_MINIO_BUCKET,required"`
|
||
|
|
// Region defaults to "us-east-1" — the region MinIO uses by default on self-hosted
|
||
|
|
// deployments. Setting a non-empty region bypasses per-request region detection.
|
||
|
|
Region string `env:"EINHERJAR_MINIO_REGION" envDefault:"us-east-1"`
|
||
|
|
// Transport is used for testing only. Nil uses the minio-go default transport.
|
||
|
|
Transport http.RoundTripper `env:"-"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// DefaultConfig returns a Config with all optional fields set to production-safe
|
||
|
|
// defaults. Callers must supply Endpoint, AccessKey, SecretKey, and Bucket.
|
||
|
|
func DefaultConfig() Config {
|
||
|
|
return Config{
|
||
|
|
UseSSL: false,
|
||
|
|
Region: "us-east-1",
|
||
|
|
}
|
||
|
|
}
|