-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(file-uploader): added base for s3 testing (#256)
* feat(file-uploader): added base for s3 testing * feat: added s3Storage logger
- Loading branch information
Showing
7 changed files
with
253 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { S3Storage } from '@repository/storage/s3/index.js'; | ||
|
||
/** | ||
* Bucket are needed to be created | ||
*/ | ||
const Buckets = [ | ||
'test', | ||
'note-attachment', | ||
]; | ||
|
||
/** | ||
* Class with methods to create buckets in storage or creating mock data in it | ||
*/ | ||
export default class S3Helpers { | ||
private s3: S3Storage; | ||
|
||
/** | ||
* Constructor for s3 helpers | ||
* | ||
* @param s3 - s3 client instance | ||
*/ | ||
constructor(s3: S3Storage) { | ||
this.s3 = s3; | ||
} | ||
/** | ||
* Create buckets in s3 storage for testing | ||
*/ | ||
public async createBuckets(): Promise<void> { | ||
for (const bucket of Buckets) { | ||
await this.s3.createBucket(bucket); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.