idk
This commit is contained in:
@@ -9,10 +9,13 @@ import (
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
)
|
||||
|
||||
var dbConn *minio.Client
|
||||
|
||||
func MinInit() {
|
||||
ctx := context.Background()
|
||||
|
||||
dbConn, err := minio.New("localhost:9000", &minio.Options{
|
||||
var err error
|
||||
dbConn, err = minio.New("localhost:9000", &minio.Options{
|
||||
Creds: credentials.NewStaticV4("root", "change_to_env", ""),
|
||||
Secure: false,
|
||||
}) // TODO change in production
|
||||
@@ -33,6 +36,9 @@ func MinInit() {
|
||||
}
|
||||
}
|
||||
|
||||
func putFile(ctx context.Context, key string, reader io.Reader, size uint32, contentType string) error {
|
||||
|
||||
func putFile(ctx context.Context, key string, reader io.Reader, size uint32, contentType string, meta map[string]string) error {
|
||||
dbConn.PutObject(ctx, globals.FileStorageBucketName, key, reader, int64(size), minio.PutObjectOptions{
|
||||
ContentType: contentType,
|
||||
UserMetadata: meta,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user