Refactor backup strategy logic into backups.js
This commit is contained in:
@@ -15,26 +15,25 @@ exports = module.exports = {
|
||||
var assert = require('assert'),
|
||||
debug = require('debug')('box:storage/noop');
|
||||
|
||||
function upload(apiConfig, backupFilePath, sourceDir, callback) {
|
||||
function upload(apiConfig, backupFilePath, sourceStream, callback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof backupFilePath, 'string');
|
||||
assert.strictEqual(typeof sourceDir, 'string');
|
||||
assert.strictEqual(typeof sourceStream, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
debug('backup: %s %s', backupFilePath, sourceDir);
|
||||
debug('upload: %s', backupFilePath);
|
||||
|
||||
callback();
|
||||
}
|
||||
|
||||
function download(apiConfig, sourceFilePath, destination, callback) {
|
||||
function download(apiConfig, backupFilePath, callback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof sourceFilePath, 'string');
|
||||
assert.strictEqual(typeof destination, 'string');
|
||||
assert.strictEqual(typeof backupFilePath, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
debug('restore: %s %s', sourceFilePath, destination);
|
||||
debug('download: %s', backupFilePath);
|
||||
|
||||
callback(new Error('Cannot restore from noop backend'));
|
||||
callback(new Error('Cannot download from noop backend'));
|
||||
}
|
||||
|
||||
function copy(apiConfig, oldFilePath, newFilePath, callback) {
|
||||
|
||||
Reference in New Issue
Block a user