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.
23 lines
478 B
23 lines
478 B
5 months ago
|
package initialize
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
"pure/global"
|
||
|
|
||
|
"github.com/minio/minio-go/v7"
|
||
|
"github.com/minio/minio-go/v7/pkg/credentials"
|
||
|
)
|
||
|
|
||
|
func Minio() {
|
||
|
minioCfg := global.MG_CONFIG.Minio
|
||
|
// Initialize minio client object.
|
||
|
minioClient, err := minio.New(minioCfg.Endpoint, &minio.Options{
|
||
|
Creds: credentials.NewStaticV4(minioCfg.AccessKeyID, minioCfg.SecretAccessKey, ""),
|
||
|
Secure: minioCfg.UseSSL,
|
||
|
})
|
||
|
if err != nil {
|
||
|
log.Fatalln(err)
|
||
|
}
|
||
|
global.MG_MINIO = minioClient
|
||
|
}
|