Files
kami-parse-server/src/FilesAdapter.js

31 lines
714 B
JavaScript
Raw Normal View History

2016-01-28 10:58:12 -08:00
// Files Adapter
//
// Allows you to change the file storage mechanism.
//
// Adapter classes must implement the following functions:
2016-02-08 22:51:58 -08:00
// * createFileAsync(config, filename, data)
// * getFileDataAsync(config, filename)
// * getFileLocation(config, request, filename)
2016-01-28 10:58:12 -08:00
//
// Default is GridStoreAdapter, which requires mongo
// and for the API server to be using the ExportAdapter
// database adapter.
2016-02-08 22:51:58 -08:00
let adapter = null;
2016-01-28 10:58:12 -08:00
2016-02-08 22:51:58 -08:00
export function setAdapter(filesAdapter) {
2016-01-28 10:58:12 -08:00
adapter = filesAdapter;
}
2016-02-08 22:51:58 -08:00
export function getAdapter() {
2016-01-28 10:58:12 -08:00
return adapter;
}
2016-02-08 22:51:58 -08:00
export class FilesAdapter {
createFileAsync(config, filename, data) { }
getFileDataAsync(config, filename) { }
getFileLocation(config, request, filename) { }
}