summary refs log tree commit diff
path: root/cdn/src/util/Storage.ts
blob: f8b09e712fe7f6ac9a53910a2d3d2346e40b50ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 };