Constructor
new StorageClass(config)
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | Configuration of the Storage |
- Source:
Methods
configure(config) → {Object}
Configure Storage part with aws configuration
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | Configuration of the Storage |
- Source:
Returns:
- Current configuration
- Type
- Object
(async) get(key, optionsopt) → {Promise}
Get a presigned URL of the file
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
String | key of the object | |
options |
Object |
<optional> |
{ level : private|public } |
- Source:
Returns:
- A promise resolves to Amazon S3 presigned URL on success
- Type
- Promise
(async) list(path, optionsopt) → {Promise}
List bucket objects relative to the level and prefix specified
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
String | the path that contains objects | |
options |
Object |
<optional> |
{ level : private|public } |
- Source:
Returns:
- Promise resolves to list of keys for all objects in path
- Type
- Promise
(async) put(key, object, options) → {Promise}
Put a file in S3 bucket specified to configure method
Parameters:
Name | Type | Description |
---|---|---|
key |
String | key of the object |
object |
Object | File to be put in Amazon S3 bucket |
options |
Object | { level : private|public, contentType: MIME Types } |
- Source:
Returns:
- promise resolves to object on success
- Type
- Promise
(async) remove(key, optionsopt) → {Promise}
Remove the object for specified key
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
String | key of the object | |
options |
Object |
<optional> |
{ level : private|public } |
- Source:
Returns:
- Promise resolves upon successful removal of the object
- Type
- Promise