Skip to content

storage: add list/stat/exists to storage instance api - #1805

Open
robertazzopardi wants to merge 1 commit into
loco-rs:masterfrom
robertazzopardi:storage-list-stat
Open

storage: add list/stat/exists to storage instance api#1805
robertazzopardi wants to merge 1 commit into
loco-rs:masterfrom
robertazzopardi:storage-list-stat

Conversation

@robertazzopardi

Copy link
Copy Markdown
Contributor

Summary

Adds exists / list / stat on the Storage instance api. I've tried to follow the existing read write apis closely.

StoreDriver and StorageStrategy now require those methods, which is a breaking change.

Mirror mode in ReplicatedStrategy falls back on miss/empty/error, skips empty secondary lists so they don't hide data (or swallow a primary error). Backup stays primary-only.

Validation

In a fresh loco app, added mem storage to AppContext in after_context, added a small /api/storage controller, then hit it with curl / request tests: upload → exists → list (recursive + not) → stat → delete.

Expose exists/list/stat (and *_with_policy) on Storage with the same
shape as the other ops. StoreDriver and StorageStrategy require the new
methods (breaking for custom impls). Replicated mirror falls back on
miss/empty/error, skips empty secondary lists, and backup stays primary-only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant