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
Use blob.OutputBuffer in blob.Reader interface instead of internal gather.WriteBuffer #1452
Use blob.OutputBuffer in blob.Reader interface instead of internal gather.WriteBuffer #1452
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1452 +/- ##
==========================================
- Coverage 68.48% 68.44% -0.04%
==========================================
Files 367 367
Lines 28920 28920
==========================================
- Hits 19805 19795 -10
- Misses 7476 7482 +6
- Partials 1639 1643 +4
Continue to review full report at Codecov.
|
I think it would be simpler to add interface like this:
and change Also, if we renamed |
Good idea, that would also give me access to Length() from the wrapper. |
318cb2d
to
1d6d979
Compare
I made the change you suggested but had to add ToByteSlice() and Append() to the interface as they were needed by eventuallyConsistentStorage and mapStorage implementations. I looked into bytes.Buffer but that is not an interface so change would be more complicated. |
I don't think we need Append and ToByteSlice - I tried adding a commit to this PR but don't have permissions to your branch, Can you add this: |
…ce() (cherry picked from commit 36d30b3)
1d6d979
to
4f53236
Compare
I cherry-picked your commit and rebased this branch to the latest master. |
Thank you for the contribution! BTW. do you want to perhaps sync up on Slack, since you're consuming Kopia in some novel ways, I'd like to make sure we stay in touch as there may be low-level changes that might break you going forward (as the golang API is not really stable yet). |
Thank you for merging the pull request! |
Exported blob.Storage interface can't be implemented as GetBlob() is using internal gather.WriteBuffer as an output argument type.
My use case is to intercept all Kopia calls to blob.Storage so I can recreate new underlying blob.Storage on the fly if AWS session expires in the middle of a long operation like creating the snapshot.
I am also using this blob.Storage wrapper to log and keep statistics of all calls to blob.Storage.
Proposed changes change the GetBlob() argument type to blob.OutputBuffer.
make command ran all tests successfully
Forum discussion reference:
https://kopia.discourse.group/t/implementing-repo-blob-reader-interface/706/4