2022-04-28 18:43:14 -07:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
exports = module.exports = {
|
|
|
|
|
api
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-24 13:19:27 +02:00
|
|
|
const BoxError = require('./boxerror.js');
|
|
|
|
|
|
2022-04-28 18:43:14 -07:00
|
|
|
function api(format) {
|
|
|
|
|
switch (format) {
|
|
|
|
|
case 'tgz': return require('./backupformat/tgz.js');
|
|
|
|
|
case 'rsync': return require('./backupformat/rsync.js');
|
|
|
|
|
}
|
2025-07-24 13:19:27 +02:00
|
|
|
|
|
|
|
|
throw new BoxError(BoxError.INTERNAL_ERROR, `Undefined format ${format}`);
|
2022-04-28 18:43:14 -07:00
|
|
|
}
|