continue minIo, rename convertion methods and http methods

This commit is contained in:
2026-04-14 22:04:12 +02:00
parent 60a02b73c0
commit 53c2f71d5d
7 changed files with 76 additions and 36 deletions
+5 -1
View File
@@ -8,6 +8,7 @@ import (
"go-socket/packages/globals"
"github.com/google/uuid"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
)
@@ -64,12 +65,15 @@ func MinInit() {
}
func upload(ctx context.Context, key string, body io.Reader, size int64, contentType string) error {
func upload(ctx context.Context, key string, body io.Reader, size int64, contentType string, uploader uuid.UUID) error {
_, err := minClient.PutObject(ctx, globals.FileStorageBucketName, key, body, size,
minio.PutObjectOptions{
ContentType: contentType,
PartSize: globals.FileProcessingPartSize,
NumThreads: globals.FileProcessingThreads,
UserMetadata: map[string]string{
"uploader": uploader.String(),
},
})
return err
}