-
Notifications
You must be signed in to change notification settings - Fork 2
feat: generate a minio client #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| export async function createMinioS3Client() { | ||
| return { | ||
| importLine: "", | ||
| sdkLine: { | ||
| minio: "sdkGenerator.createMinioS3Client({...config?.minio}),", | ||
| }, | ||
| }; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { Client } from "minio"; | ||
|
|
||
| export function createMinioS3Client({ endPoint }: { endPoint: string }) { | ||
| return new Client({ | ||
| endPoint: endPoint, | ||
| port: 443, | ||
| useSSL: true, | ||
|
Comment on lines
+6
to
+7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Make port and SSL settings configurable The hardcoded port and SSL settings might not be flexible enough for all use cases. Consider making these configurable by accepting them as parameters or reading from configuration. |
||
| accessKey: process.env.SETTLEMINT_MINIO_ACCESS_KEY ?? "", | ||
| secretKey: process.env.SETTLEMINT_MINIO_SECRET_KEY ?? "", | ||
|
Comment on lines
+8
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (review_instructions): Consider adding validation for required environment variables. It's a good practice to validate that these environment variables are set before using them. If they're required for the client to function correctly, you might want to throw an error if they're not present. Review instructions:Path patterns: Instructions:
|
||
| }); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (review_instructions): Consider adding error handling for potential connection issues.
While the code is functional, it might be beneficial to add error handling to manage potential connection failures or invalid credentials. This would improve the robustness of the function.
Review instructions:
Path patterns:
**/*.tsInstructions: