idk
This commit is contained in:
+10
-11
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
"go-socket/packages/globals"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/minio/minio-go/v7"
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
)
|
||||
@@ -65,16 +64,16 @@ func Init() {
|
||||
|
||||
}
|
||||
|
||||
func Upload(ctx context.Context, key string, body io.Reader, size int64, contentType string, id 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{
|
||||
"id": id.String(),
|
||||
},
|
||||
})
|
||||
func Upload(ctx context.Context, key string, body io.Reader, size int64, contentType string, metadata map[string]string) error {
|
||||
opt := minio.PutObjectOptions{
|
||||
ContentType: contentType,
|
||||
PartSize: globals.FileProcessingPartSize,
|
||||
NumThreads: globals.FileProcessingThreads,
|
||||
UserMetadata: metadata,
|
||||
}
|
||||
opt.SetMatchETagExcept("*")
|
||||
|
||||
_, err := minClient.PutObject(ctx, globals.FileStorageBucketName, key, body, size, opt)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user