Icon Library - Storage Provider
Storage Provider used to define a contract for all storage process in the Icon Library project.
StorageBaseProvider
Methods to implement
abstract
class
StorageBaseProviderabstract
function
list(string
path,number
skip,number
take)abstract
function
upload(Stream
stream,Object
options)abstract
function
download(string
filepath)abstract
function
remove(string
filepath)
Implementations
- oss (ovh-iconlib-provider-storage-oss)
License
See LICENSE
file
OSS example
Installation
npm install --save ovh-iconlib-provider-storage ovh-iconlib-provider-storage-oss
Configuration
# config.yml ---connections: - name: test authUrl: ${OSS_AUTH_URL} username: ${OSS_USERNAME} password: ${OSS_PASSWORD} region: ${OSS_REGION} container: ${OSS_CONTAINER}storage: default: oss providers: - name: oss type: ovh-iconlib-provider-storage-oss connection: test
Usage
// default provider instance loaded according to the configurationconst storage = ;
// get filesstorage ;
// upload filelet stream = ...;storage ;
// remove filestorage ;