feat: add utility function
This commit is contained in:
parent
2f73dd1634
commit
1f6ab0027d
1 changed files with 4 additions and 0 deletions
|
|
@ -18,6 +18,10 @@ export async function listFile(path: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getFile(path: string, exp = 60 * 60) {
|
||||||
|
return await minio.presignedGetObject(MINIO_BUCKET, path, exp);
|
||||||
|
}
|
||||||
|
|
||||||
export async function deleteFile(path: string) {
|
export async function deleteFile(path: string) {
|
||||||
await minio.removeObject(MINIO_BUCKET, path, { forceDelete: true });
|
await minio.removeObject(MINIO_BUCKET, path, { forceDelete: true });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue