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:17:41 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:17:41 +0200
commite01550d13c1df75d919166fd1635a8565ab858c5 (patch)
tree73cb1f1954024f01973292c0c120a363dfceaed0 /cdn/src/util/Storage.ts
parent:bug: fix rabbit mq -> fanout instead of work queue (diff)
parent:sparkles: cdn (diff)
downloadserver-e01550d13c1df75d919166fd1635a8565ab858c5.tar.xz
Merge branch 'master' into gateway
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 };