|
@@ -2,6 +2,7 @@ package services
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
+ "fmt"
|
|
|
"github.com/minio/minio-go/v7"
|
|
|
"github.com/minio/minio-go/v7/pkg/credentials"
|
|
|
"log"
|
|
@@ -9,10 +10,10 @@ import (
|
|
|
|
|
|
func UploadMinIo() {
|
|
|
ctx := context.Background()
|
|
|
- endpoint := "http://8.136.199.33:9001/"
|
|
|
- accessKeyID := "test"
|
|
|
- secretAccessKey := "LfQ8uiJiLP7vLxjRrmNW"
|
|
|
- useSSL := true
|
|
|
+ endpoint := "8.136.199.33:9000/"
|
|
|
+ accessKeyID := "LfQ8uiJiLP7vLxjRrmNW"
|
|
|
+ secretAccessKey := "IszGVHsNicJMQxHC46cYFtbrOiapo0ynwOIJ6c2R"
|
|
|
+ useSSL := false
|
|
|
|
|
|
// Initialize minio client object.
|
|
|
minioClient, err := minio.New(endpoint, &minio.Options{
|
|
@@ -39,7 +40,10 @@ func UploadMinIo() {
|
|
|
} else {
|
|
|
log.Printf("Successfully created %s\n", bucketName)
|
|
|
}
|
|
|
-
|
|
|
+ buckets,err := minioClient.ListBuckets(ctx)
|
|
|
+ for _, bucket := range buckets {
|
|
|
+ fmt.Println(bucket)
|
|
|
+ }
|
|
|
// Upload the zip file
|
|
|
objectName := "1111.xlsx"
|
|
|
filePath := "/Users/xi/Desktop/1111.xlsx"
|