Update README.md to provide a comprehensive overview of The Order monorepo, including repository structure, quickstart guide, development workflow, and contribution guidelines.
This commit is contained in:
26
packages/storage/src/worm.ts
Normal file
26
packages/storage/src/worm.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* WORM (Write Once Read Many) mode storage
|
||||
*/
|
||||
|
||||
import { StorageClient, StorageObject } from './storage';
|
||||
|
||||
export class WORMStorage extends StorageClient {
|
||||
async upload(object: StorageObject): Promise<string> {
|
||||
// WORM mode: prevent overwrites
|
||||
const exists = await this.objectExists(object.key);
|
||||
if (exists) {
|
||||
throw new Error(`Object ${object.key} already exists in WORM storage`);
|
||||
}
|
||||
return super.upload(object);
|
||||
}
|
||||
|
||||
async delete(key: string): Promise<void> {
|
||||
throw new Error('Deletion not allowed in WORM mode');
|
||||
}
|
||||
|
||||
private async objectExists(key: string): Promise<boolean> {
|
||||
// Implementation to check if object exists
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user