29 lines
476 B
Go
29 lines
476 B
Go
package minio
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/minio/minio-go/v7"
|
|
"github.com/minio/minio-go/v7/pkg/credentials"
|
|
)
|
|
|
|
func MinInit() {
|
|
ctx := context.Background()
|
|
|
|
dbConn, err := minio.New("localhost:9000", &minio.Options{
|
|
Creds: credentials.NewStaticV4("root", "change_to_env", ""),
|
|
Secure: false,
|
|
}) // TODO change in production
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
exists, err := dbConn.BucketExists(ctx, "main")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
if !exists {
|
|
}
|
|
}
|