Add generic BlobPersistence plugin for Azure/GCS support#47
Closed
PabloSzx wants to merge 3 commits into
Closed
Conversation
Adds a new persistence plugin that accepts a simple adapter interface (put/get/del/init) so callers can bring their own cloud SDK. Also fixes the S3 types export path typo in package.json.
Adds module-level docs explaining the relationship to S3PersistenceV1, complete Azure and GCS usage examples, and detailed JSDoc for the BlobAdapter interface and all public methods.
Documents the generic BlobPersistence plugin alongside S3PersistenceV1, including the BlobAdapter interface, usage example, and behavior notes.
Member
|
Thanks for the PR @PabloSzx This wrapper makes it slightly more convenient to write a custom blob storage adapter. The implementation looks solid. However, the overall design looks very similar to the existing plugin interface for custom storage adapters. I'd rather like to maintain a specific Azure blob adapter. I'm sure there will be a bunch of edge-cases to catch - similarly to the s3 adapter. At this point I don't want to maintain another abstraction - sorry! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BlobPersistenceplugin (src/plugins/blob.js) that accepts a simple adapter interface (put/get/del/init?), allowing callers to bring their own cloud SDK (Azure Blob Storage, GCS, etc.) without adding new dependencies to yhub./plugins/blobpackage exportdist/src/storage/s3.d.ts→dist/src/plugins/s3.d.ts).env.templateMotivation
We need to deploy yhub to environments with Azure Blob Storage and GCS natively, where S3-compatible storage is not available. The existing plugin architecture already supports this —
BlobPersistenceis a thin adapter that implementsPersistencePluginand delegates all cloud-specific logic (auth, retries, 404 handling) to the caller-provided adapter.No changes to existing files (
s3.js,persistence.js,types.js,index.js) —S3PersistenceV1remains unchanged.Usage
Test plan
npm run lintpasses (standard + tsc)BlobPersistencewith an in-memory adapter, verify store/retrieve/delete