feat: direct blob#503
Merged
jakobmoellerdev merged 7 commits intoAug 8, 2025
Merged
Conversation
this implements a direct blob, aka a blob that can be read from many times independently but that does not buffer itself. this is especially useful when forwarding already existing buffers such as bytes.Buffer or plain []byte slices. One caveat towards the existing "inmemory" implementation is that because it does not buffer itself, we cannot know the digest and if someone wants to compute it, they will have to buffer the data themselves and compute it dynamically. Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
this implements a direct blob, aka a blob that can be read from many times independently but that does not buffer itself. this is especially useful when forwarding already existing buffers such as bytes.Buffer or plain []byte slices. One caveat towards the existing "inmemory" implementation is that because it does not buffer itself, we cannot know the digest and if someone wants to compute it, they will have to buffer the data themselves and compute it dynamically. Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
bc41057 to
647a99e
Compare
Skarlso
reviewed
Aug 6, 2025
Skarlso
left a comment
Contributor
There was a problem hiding this comment.
I have a couple of questions... hopefully they aren't that much of a trouble. :D
7 tasks
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Skarlso
previously approved these changes
Aug 7, 2025
Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Member
Author
|
forgot to rollback the README, just updated that now |
Skarlso
approved these changes
Aug 8, 2025
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.
What this PR does / why we need it
this implements a direct blob, a blob that can be read from many times independently but that does not buffer itself backed by
io.Readerthis is especially useful when forwarding already existing buffers such as bytes.Buffer or plain []byte slices, or using readers created by
strings.NewReaderorbytes.NewReader. All of these implementations are fully compatible with this implementation. Even using an os file descriptors or http responses directly is valid.Which issue(s) this PR fixes
One caveat towards the existing "inmemory" implementation is that because it does not buffer data itself, we cannot know the digest in advance and if someone wants to compute it, they will have to buffer the data themselves and compute it dynamically. The obvious upside though is that we can write blob providers that do not implicitly cache data on the source, but rather get cached on demand.
part of open-component-model/ocm-project#580