17 lines
507 B
Go
17 lines
507 B
Go
package minio
|
|
|
|
import (
|
|
"github.com/minio/minio-go/v7"
|
|
"github.com/minio/minio-go/v7/pkg/credentials"
|
|
)
|
|
|
|
// Connect initializes a MinIO client using the given credentials. Callers
|
|
// are expected to source endpoint/accessKey/secretKey from configuration
|
|
// rather than hardcoding them.
|
|
func Connect(endpoint, accessKey, secretKey string, useSSL bool) (*minio.Client, error) {
|
|
return minio.New(endpoint, &minio.Options{
|
|
Creds: credentials.NewStaticV4(accessKey, secretKey, ""),
|
|
Secure: useSSL,
|
|
})
|
|
}
|