summary refs log tree commit diff
path: root/cdn/src/util/Storage.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:16:45 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:16:45 +0200
commit71eeb8df01442f8068d7ad2ec582057351cac0b0 (patch)
tree4bc51b92f6149e28425ad590ba87ea72cfa3a586 /cdn/src/util/Storage.ts
parentMerge branch 'cdn' (diff)
downloadserver-71eeb8df01442f8068d7ad2ec582057351cac0b0.tar.xz
:sparkles: cdn
Diffstat (limited to 'cdn/src/util/Storage.ts')
-rw-r--r--cdn/src/util/Storage.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/cdn/src/util/Storage.ts b/cdn/src/util/Storage.ts
new file mode 100644

index 00000000..f8b09e71 --- /dev/null +++ b/cdn/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 };