Skip to content
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

Implement fs.FS for backends and add helper #2

Open
wojas opened this issue Apr 26, 2022 · 0 comments
Open

Implement fs.FS for backends and add helper #2

wojas opened this issue Apr 26, 2022 · 0 comments

Comments

@wojas
Copy link
Member

wojas commented Apr 26, 2022

To allow streaming reading of larger blobs, implement the fs.FS interface in all backends.

For convenience, also provide a fallback implementation that simply uses the existing Interface to load the data.

To retrieve the FS interface for a backend, a program would call this convenience method:

// AsFS returns an fs.FS implementation for the given storage backend.
// If the storage backend implements fs.FS, that is returned. If it does not, a generic implementation
// that implements it using Interface is returned instead.
func AsFS(st Interface) fs.FS
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

No branches or pull requests

1 participant