continue minIo, rename convertion methods and http methods
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user