Refactor storage integration from MinIO to S3
- Removed MinIO client and related imports from various modules. - Introduced S3 client and OSS integration for object storage. - Updated all references to MinIO methods with corresponding S3 methods. - Added new flowme table schema to the database. - Adjusted upload and download routes to utilize S3 for file operations. - Removed obsolete MinIO-related files and routes. - Ensured compatibility with existing application logic while transitioning to S3.
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
import { bucketName, minioClient } from '@/modules/minio.ts';
|
||||
import { S3Error } from 'minio';
|
||||
const main = async () => {
|
||||
const res = await new Promise((resolve, reject) => {
|
||||
let res: any[] = [];
|
||||
let hasError = false;
|
||||
minioClient
|
||||
.listObjectsV2(bucketName, 'root/codeflow/0.0.1/')
|
||||
.on('data', (data) => {
|
||||
res.push(data);
|
||||
})
|
||||
.on('error', (err) => {
|
||||
console.error('error', err);
|
||||
hasError = true;
|
||||
})
|
||||
.on('end', () => {
|
||||
if (hasError) {
|
||||
reject();
|
||||
return;
|
||||
} else {
|
||||
resolve(res);
|
||||
}
|
||||
});
|
||||
});
|
||||
console.log(res);
|
||||
};
|
||||
// main();
|
||||
|
||||
const main2 = async () => {
|
||||
try {
|
||||
const obj = await minioClient.statObject(bucketName, 'root/codeflow/0.0.1/README.md');
|
||||
|
||||
console.log(obj);
|
||||
} catch (e) {
|
||||
console.log('', e.message, '\n\r', e.code);
|
||||
// console.error(e);
|
||||
}
|
||||
};
|
||||
|
||||
main2();
|
||||
4
src/test/s3-stat.ts
Normal file
4
src/test/s3-stat.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { oss } from '@/modules/s3.ts'
|
||||
|
||||
const stat = await oss.statObject('root/codepod/0.0.3/index.html');
|
||||
console.log('Object Stat:', stat);
|
||||
Reference in New Issue
Block a user