data2minio/minio/index.go

16 lines
387 B
Go
Raw Permalink Normal View History

2023-04-01 16:43:13 +08:00
package minio
import (
2023-04-02 23:35:12 +08:00
"github.com/minio/minio-go/v7"
2023-04-01 16:43:13 +08:00
"github.com/minio/minio-go/v7/pkg/credentials"
)
2023-04-02 23:35:12 +08:00
func NewMinioClient(endpoint, successKeyId, secretAccessKey string) (*minio.Client, error) {
2023-04-01 16:43:13 +08:00
opt := &minio.Options{
Creds: credentials.NewStaticV4(successKeyId, secretAccessKey, ""),
Secure: false,
}
minioClient, err := minio.New(endpoint, opt)
2023-04-02 23:35:12 +08:00
return minioClient, err
2023-04-01 16:43:13 +08:00
}