add minio and file upload
This commit is contained in:
16
pkg/minio/minio.go
Normal file
16
pkg/minio/minio.go
Normal file
@@ -0,0 +1,16 @@
|
||||
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,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user