You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
549 B
21 lines
549 B
package configStruct
|
|
|
|
import (
|
|
"github.com/minio/minio-go/v6"
|
|
)
|
|
|
|
type MinIO struct {
|
|
Endpoint string `env:"MINIO_ENDPOINT" envDefault:"localhost:9000" configPath:"Minio.Endpoint"`
|
|
Key string `env:"MINIO_Key" envDefault:"root" configPath:"Minio.Key"`
|
|
Secret string `env:"MINIO_SECRET" envDefault:"rootroot" configPath:"Minio.Secret"`
|
|
Bucket string `env:"MINIO_BUCKET" envDefault:"DouTok" configPath:"Minio.Bucket"`
|
|
}
|
|
|
|
func (m *MinIO) InitIO() (*minio.Client, error) {
|
|
return minio.New(
|
|
m.Endpoint,
|
|
m.Key,
|
|
m.Secret,
|
|
false,
|
|
)
|
|
}
|
|
|