es6/api/backups/client/index.js
/**
 * Creates a promise which on success provides a client that can talk to a rqlite data api.
 * @param {object|string} options Options for that will be used on all connections or the
 * url if it is a string.
 * @param {string} options.url The url for all connections i.e. http://localhost:4001.
 * @param {object} options.httpOptions The default options that are applied to all HTTP clients.
 * @param {object} options.httpOptions.agent An agent to be used instead of the default
 * http agent, this is useful for keep alive.
 */
Creates a promise which on success provides a client that can talk to a rqlite data api.
@param {object|string} options Options for that will be used on all connections or the
url if it is a string.
Creates a promise which on success provides a client that can talk to a rqlite data api . @param { object|string } options Options for that will be used on all connections or the url if it is a string .
async function connect(options = {}) {
  const opts = _isString(options) ? { url: options } : options
  const { url } = opts
  if (!url) {
    throw new Error('The url option is required to connect to a data api.')
  }
  return {
    backup: _partial(clientConnect, opts, backupApi),
    restore: _partial(clientConnect, opts, restoreApi),
  }
}
async function connect ( options = { } ) { const opts = _isString ( options ) ? { url : options } : options const { url } = opts if ( ! url ) { throw new Error ( 'The url option is required to connect to a data api.' ) } return { backup : _partial ( clientConnect , opts , backupApi ) , restore : _partial ( clientConnect , opts , restoreApi ) , } }
Creates a promise which on success provides a client that can talk to a rqlite data api.
Creates a promise which on success provides a client that can talk to a rqlite data api .