summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/FileStorage.ts7
-rw-r--r--src/util/Storage.ts14
2 files changed, 21 insertions, 0 deletions
diff --git a/src/util/FileStorage.ts b/src/util/FileStorage.ts
new file mode 100644

index 00000000..01be0050 --- /dev/null +++ b/src/util/FileStorage.ts
@@ -0,0 +1,7 @@ +import { Storage } from "./Storage"; + +export class FileStorage implements Storage { + async get(path: string, prefix?: string) {} + + async set(path: string, value: any) {} +} diff --git a/src/util/Storage.ts b/src/util/Storage.ts new file mode 100644
index 00000000..ad00fbb7 --- /dev/null +++ b/src/util/Storage.ts
@@ -0,0 +1,14 @@ +import { FileStorage } from "./FileStorage"; + +export interface Storage { + set(hash: string, data: any, prefix?: string): Promise<void>; + get(hash: string, prefix?: string): Promise<any>; +} + +var storage: Storage; + +if (process.env.STORAGE_PROVIDER === "file") { + storage = new FileStorage(); +} + +export { storage };