From 8f66556f5acf149fadd2fe0ac9e03f5e6225026e Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Thu, 27 May 2021 18:54:15 +0200 Subject: :construction: WIP rewrite --- src/util/FileStorage.ts | 7 +++++++ src/util/Storage.ts | 14 ++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/util/FileStorage.ts create mode 100644 src/util/Storage.ts (limited to 'src/util') 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; + get(hash: string, prefix?: string): Promise; +} + +var storage: Storage; + +if (process.env.STORAGE_PROVIDER === "file") { + storage = new FileStorage(); +} + +export { storage }; -- cgit 1.5.1