|
|
@ -31,18 +31,16 @@ export default class MinioService extends SiteService { |
|
|
|
} |
|
|
|
|
|
|
|
async uploadFile (fileInfo) { |
|
|
|
const result = await this.minio.fPutObject( |
|
|
|
return this.minio.fPutObject( |
|
|
|
fileInfo.bucket, |
|
|
|
fileInfo.key, |
|
|
|
fileInfo.filePath, |
|
|
|
fileInfo.metadata |
|
|
|
); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
async downloadFile (fileInfo) { |
|
|
|
const obj = await this.minio.fGetObject(fileInfo.bucket, fileInfo.key, fileInfo.filePath); |
|
|
|
return obj; |
|
|
|
return this.minio.fGetObject(fileInfo.bucket, fileInfo.key, fileInfo.filePath); |
|
|
|
} |
|
|
|
|
|
|
|
async openDownloadStream (fi) { |
|
|
@ -51,20 +49,18 @@ export default class MinioService extends SiteService { |
|
|
|
const stream = await this.minio.getPartialObject(fi.bucket, fi.key, fi.range.start, length); |
|
|
|
return stream; |
|
|
|
} |
|
|
|
const stream = await this.minio.getObject(fi.bucket, fi.key); |
|
|
|
return stream; |
|
|
|
return this.minio.getObject(fi.bucket, fi.key); |
|
|
|
} |
|
|
|
|
|
|
|
async removeObject (bucket, key) { |
|
|
|
await this.minio.removeObject(bucket, key); |
|
|
|
return this.minio.removeObject(bucket, key); |
|
|
|
} |
|
|
|
|
|
|
|
async statObject (bucket, key) { |
|
|
|
const stat = await this.minio.statObject(bucket, key); |
|
|
|
return stat; |
|
|
|
return this.minio.statObject(bucket, key); |
|
|
|
} |
|
|
|
|
|
|
|
async statFile (file) { |
|
|
|
return await this.statObject(file.bucket, file.key); |
|
|
|
return this.statObject(file.bucket, file.key); |
|
|
|
} |
|
|
|
} |