Skip to content

Commit 144e465

Browse files
committed
updated REDME.MD supports for all storage pipe functionality
1 parent 0fd502c commit 144e465

2 files changed

Lines changed: 83 additions & 5 deletions

File tree

README.md

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,88 @@ node_storage_manager allows you to switch between clients easily without reconfi
146146
console.log(`file downloaded`);
147147
}
148148
```
149+
### Integration Samples
150+
## API Documentation
149151

152+
### StorageInstance functions
153+
154+
This contains a reference to the storage-pipe module. It is a valid use case to use
155+
both this module and all it's functions
156+
157+
### StorageInstance.download()
158+
Download file from S3, AWS & NFS using sotrage pipe
159+
160+
`parameters`:
161+
162+
* `bucketName` - required, S3 bucket name to download files from.
163+
* `filename` - required, file to download from bucket
164+
* `destination` - required, where to put the file when done downloading
165+
166+
### StorageInstance.upload()
167+
Uploads file to S3, AWS & NFS using sotrage pipe
168+
169+
`parameters`:
170+
* `bucketName` - required, S3 bucket name to upload files to.
171+
* `filename` - required, file to up to bucket
172+
* `destination` - optional, for renaming file during upload i.e if file bob.jpg is beign uploaded setting `destination` on upload method will use `destination` value to rename the file
173+
174+
`parameters required if on CLOUDINARY Instance`:
175+
* `bucketName` - required, S3 bucket name to upload files to.
176+
* `filename` - required, file to up to bucket
177+
* `fileType` - required, Type of file to upload e.g image, video
178+
179+
180+
### StorageInstance.createBucket()
181+
Create's Bucket in S3, AWS & NFS using sotrage pipe
182+
183+
`parameters required if on S3 Instance`:
184+
* `bucketName` - required, Bucketname to Create.
185+
* `ACL` - required, Define which AWS accounts or groups are granted access and the type of access. e.g public-read
186+
187+
`parameters required if on GCLOUD Instance`:
188+
* `bucketName` - required, Bucketname to Create.
189+
* `location` - required, Define specific region e.g ASIA
190+
* `storageClass` - optinal, e.g coldline default storage or Leave the second argument blank for default settings.
191+
192+
`parameters required if on NFS Instance`:
193+
* `bucketName` - required, Bucketname to Create.
194+
195+
196+
### StorageInstance.deleteBucket()
197+
Delete Bucket in S3, AWS & NFS using sotrage pipe
198+
199+
`parameters required`:
200+
* `bucketName` - required, Bucketname to Delete.
201+
202+
203+
### StorageInstance.listBuckets()
204+
List Buckets in S3, AWS & NFS using sotrage pipe
205+
206+
`parameters required`:
207+
* `None` - No parameters Required
208+
209+
210+
### StorageInstance.listFiles()
211+
List files in Bucket on S3, AWS & NFS using sotrage pipe
212+
213+
`parameters required`:
214+
* `bucketName` - required, Bucketname to List files from.
215+
216+
217+
### StorageInstance.deleteFile()
218+
Delete file in Bucket on S3, AWS & NFS using sotrage pipe
219+
220+
`parameters required`:
221+
* `bucketName` - required, Bucketname to delete file from.
222+
* `filename` - required, Filen to delete
223+
224+
225+
### StorageInstance.getBucketMetadata()
226+
Get metadata from GCLOUD Storage `Note these is only applicable to GCLOUD instance alone`
227+
228+
`parameters required`:
229+
* `bucketName` - required, Bucketname to fetch it's metadata
150230

151-
### Integration Samples
152-
Still Updating README.MD file would publish soon
153231

154232

155233
## Versioning

test/sdk.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ describe('Simple Storage Test', () => {
66

77
//First stage Unit Test
88
it('should run', () => {
9-
let StorageInstance = storageSystem.getInstance('NFS');
10-
StorageInstance.download('media', 'dev_key.key', '/Users/nitrocode/tmp/');
11-
console.log(StorageInstance);
9+
let StorageInstance = storageSystem.getInstance('CLOUDINARY');
10+
const data = StorageInstance.upload('media', '/Users/nitrocode/tmp/up.png', 'video');
11+
console.log(data);
1212
});
1313

1414
});

0 commit comments

Comments
 (0)