initialize generic rms-software repository
Add the reusable RMS core application (server, web UI, plugins, tests, tools) with generic defaults, GPL licensing, and maintainer context documentation so deployments can consume this repo as software source independent of station-specific overlays.
This commit is contained in:
47
server/storage/custom-storage-template.js
Normal file
47
server/storage/custom-storage-template.js
Normal file
@@ -0,0 +1,47 @@
|
||||
function createStorage(config) {
|
||||
return {
|
||||
id: "custom-template",
|
||||
|
||||
async init() {
|
||||
// Initialize connections/resources here.
|
||||
},
|
||||
|
||||
async exists(key) {
|
||||
// Return true/false for existence of key.
|
||||
return false;
|
||||
},
|
||||
|
||||
async readJson(key, fallback = null) {
|
||||
// Return parsed object or fallback.
|
||||
return fallback;
|
||||
},
|
||||
|
||||
async writeJson(key, value) {
|
||||
// Persist JSON object.
|
||||
void key;
|
||||
void value;
|
||||
},
|
||||
|
||||
async appendText(key, text) {
|
||||
// Append one line/chunk (used for audit log).
|
||||
void key;
|
||||
void text;
|
||||
},
|
||||
|
||||
async readText(key, fallback = "") {
|
||||
// Return full text content or fallback.
|
||||
void key;
|
||||
return fallback;
|
||||
},
|
||||
|
||||
async writeText(key, text) {
|
||||
// Overwrite full text content.
|
||||
void key;
|
||||
void text;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
createStorage
|
||||
};
|
||||
Reference in New Issue
Block a user