-
Notifications
You must be signed in to change notification settings - Fork 183
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
create pass-through writer and iowriter #182
Conversation
325cabd
to
bfb413b
Compare
Thanks for rebasing on master @jdolitsky . Any other comments on it? |
@deitch code lgtm - can we add a few unit tests for these? Or I suppose they can be added w/ the Gunzip/Untar writers? |
Yeah, that is a good idea. At least for the |
80ba01b
to
2fb8c56
Compare
A bit odd to do, but I think this works for the test. |
@deitch can you check failing CI? |
2fb8c56
to
11fb40a
Compare
@jdolitsky I ran it multiple times locally, I cannot see the failure. Could be transient. I am repushing to kick off again |
Nope that failed too. The failure doesn't appear to have anything to do with this PR, but I am not sure.
Any ideas? Here is the output https://github.com/deislabs/oras/pull/182/checks?check_run_id=1210937435 |
What is wrong with the CI run @jdolitsky ? |
11fb40a
to
9fe43b5
Compare
@jdolitsky I rebased onto master, but also took advantage to simplify the interface, which ended up simplifying the code and blocksize stuff materially, while hewing much more closely to the classic golang style. Take a look, and let's get this in? It has been open for a good few weeks. |
9fe43b5
to
6b368e2
Compare
And CI is all clean. Even better. |
Shoot. It deleted all my changes! I have to recreate them! |
6b368e2
to
22c6bd3
Compare
Phew. Managed to recover it all. Back at you @jdolitsky |
And CI is green. |
85ad772
to
a1a136f
Compare
Signed-off-by: Avi Deitcher <avi@deitcher.net>
a1a136f
to
3984d94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Excellent. I have gunzip and untar writers ready to go based on this. |
As discussed with @SteveLasker , this is the first of 2-3 PRs expanding the capabilities of the
store
package.There are two additions here:
PassthroughWriter
that lets you wrap any other underlying store (e.g. file, memory) and have a processor function in the middle. Thus if I wanted to decrypt the content in transit, or uncompress, or any other action, I have a simple framework for doing so.IoWriter
is very similar toFileStore
, except instead of taking a directory and opening files, it takes an actualio.Writer
and passes it through. I have used it to, e.g. write directly to block devices, and to write to another stream over a network. It is more fine-grained control as you can pass it anyio.Writer
you want.Once these are in, I have two more that take advantage of the
PassthroughWriter
:GunzipWriter
andUntarWriter
.