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

index 00000000..f8b09e71 --- /dev/null +++ b/src/util/Storage.ts
@@ -0,0 +1,15 @@ +import { FileStorage } from "./FileStorage"; + +export interface Storage { + set(path: string, data: Buffer): Promise<void>; + get(path: string): Promise<Buffer | null>; + delete(path: string): Promise<void>; +} + +var storage: Storage; + +if (process.env.STORAGE_PROVIDER === "file") { + storage = new FileStorage(); +} + +export { storage };