Make Chunker.Next read "generic" and independent from digest size. (#236)

* Make Chunker.Next read "generic" and independent from digest size.

These are both pre-works for adding write compression support to the
remote-apis-sdks.

Chunker.Next should be "generic" as it allows for a drop in implementation
of a reader that compresses on the fly. I still left the special case of
caching data in memory as it saves the effort from memory copies.

Making the chunker reads work independently from the digest size is also
useful as it allows us to not have to pre-compute the digest of the
compressed blobs. The current draft of the RE API never requires the
digest of the compressed blob at any point, and this saves us the
trouble of needing to read the data twice.

Notice that this implies that the chunker won't be actually matching
data against the supplied digest at any moment. The digest is now purely
information storage, rather than necessary for chunker logic.

As a caveat, for simplicity, I made it that we only cache in memory
files that are smaller than the *chunk* size rather than the IO buffer
size.

* Break reader in its own package.

* Change Seek -> SeekOffset so govet will stop complaining.

* Fix nit typo

* Use test_util.CreateFile

* Converge io.EOF and io.UnexpectedEOF errors cases

* Re-add t.Parallel
6 files changed
tree: 57fcda4dc207737ea6ed2ddba9af82d34fe970ae
  1. .bazelci/
  2. .githooks/
  3. external/
  4. go/
  5. .gitignore
  6. AUTHORS
  7. BUILD.bazel
  8. check-gofmt.sh
  9. CONTRIBUTING.md
  10. CONTRIBUTORS
  11. go.mod
  12. go.sum
  13. LICENSE
  14. README.md
  15. remote-apis-sdks-deps.bzl
  16. setup-githooks.sh
  17. WORKSPACE
README.md

Remote Execution API SDKs

CI status: Build Status

PkgGoDev

This repository contains SDKs for the Remote Execution API.

See each language subdirectory's README.md for more specific instructions on using the SDK for that language.