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

Can we make the proxy struct and related methods public? #163

Closed
qweeah opened this issue Jun 7, 2022 · 1 comment
Closed

Can we make the proxy struct and related methods public? #163

qweeah opened this issue Jun 7, 2022 · 1 comment

Comments

@qweeah
Copy link
Contributor

qweeah commented Jun 7, 2022

When working on upgrading pull command for ORAS CLI, I need to create a OCI store to avoid fetching duplicated blobs again and again from the remote source. I found the internal Proxy struct in ORAS-go's internal cas package is just what I need. Can we make the proxy struct public so clients can reuse it to build light-weight read-through caches?

Pros:
ORAS-go users can reuse the code to build caches in their software.

Cons:
The current implementation is only a read-through cache with no consistency guaranteed. If any blob is deleted on the origin storage side, the change won't be reflected in the proxy.

@shizhMSFT
Copy link
Contributor

shizhMSFT commented Jun 9, 2022

The Proxy can be easily misused. For examples,

  • Accidentally caching everything in the memory and blow up the memory.
  • Cache is never invalidated and may cause data inconsistency.

Also, Proxy is a content.Storage and is not an oras.Target. Thus, it cannot be used in other copy functions except CopyGraph().

Therefore, it is not suitable to be made public.

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 a pull request may close this issue.

2 participants