API Docs for: 0.9.0
Show:

ConnectionAdapter Class

Connection adapter constructor

Constructor

ConnectionAdapter

(
  • [options]
  • _promise
)

Parameters:

  • [options] Object optional
  • _promise Promise

Methods

_request

(
  • options
)
Promise private

Makes a request and returns a promise

Parameters:

  • options Object
    • url String

      Url of host

    • method String

      Method of request

    • [headers] Object optional

      Request headers

    • [body] String | Buffer optional

      Body of request

Returns:

Promise:

With {object} Response

getBucketKeys

(
  • bucket
  • [filterFn]
)
Promise

Gets all bucket keys

Parameters:

Returns:

Promise:

With {string[]} Bucket keys

getBuckets

(
  • [filterFn]
)
Promise

Gets all bucket names

Parameters:

Returns:

Promise:

With {string[]} List of buckets

getObject

(
  • bucket
  • key
)
Promise

Gets an object

Parameters:

Returns:

Promise:

With {Buffer}

getObjectAsJSON

(
  • bucket
  • key
)
Promise

Gets an object as JSON

Parameters:

Returns:

Promise:

With {*}

getPromise

() Promise

Gets the source-adapter promise

Returns:

Promise:

hasBucket

(
  • bucket
  • [filterFn]
)
Promise

Does the instance have a specific bucket?

Parameters:

Returns:

Promise:

With {boolean} Bucket exists?

hasBucketKey

(
  • bucket
  • key
  • [filterFn]
)
Promise

Does the instance have a specific key in a bucket?

Parameters:

Returns:

Promise:

With {boolean} Bucket key exists?

initialize

()

Initializes the source-adapter

removeAllObjects

(
  • bucket
)
Promise

Removes all object of a bucket

Parameters:

Returns:

Promise:

removeObject

(
  • bucket
  • key
)
Promise

Removes an object

Parameters:

Returns:

Promise:

setObject

(
  • bucket
  • key
  • data
  • [mimeType='application/octet-stream']
)
Promise

Sets an object

Parameters:

Returns:

Promise:

setObjectFromJSON

(
  • bucket
  • key
  • data
)
Promise

Sets an object from JSON

Parameters:

Returns:

Promise:

setPromise

(
  • promise
)

Sets the promise

Parameters:

  • promise Promise

Properties