Documentation ¶
Index ¶
- func ExtractLogicalSize(rc io.ReadCloser) (io.ReadCloser, int64, error)
- func GetLegacyZstdReadCloser(zstd zstdimpl.ZstdImpl, f *os.File) (io.ReadCloser, error)
- func GetUncompressedReadCloser(zstd zstdimpl.ZstdImpl, f *os.File, expectedSize int64, offset int64) (io.ReadCloser, error)
- func GetZstdReadCloser(zstd zstdimpl.ZstdImpl, f *os.File, expectedSize int64, offset int64) (io.ReadCloser, error)
- func WriteAndClose(zstd zstdimpl.ZstdImpl, r io.Reader, f *os.File, t CompressionType, ...) (int64, error)
- type CompressionType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractLogicalSize ¶
func ExtractLogicalSize(rc io.ReadCloser) (io.ReadCloser, int64, error)
Extract the logical size of a v2 cas blob from rc, and return that size along with an equivalent io.ReadCloser to rc.
func GetLegacyZstdReadCloser ¶
GetLegacyZstdReadCloser returns an io.ReadCloser that provides zstandard-compressed data from an uncompressed file.
func GetUncompressedReadCloser ¶
func GetUncompressedReadCloser(zstd zstdimpl.ZstdImpl, f *os.File, expectedSize int64, offset int64) (io.ReadCloser, error)
Returns an io.ReadCloser that provides uncompressed data. The caller must close the returned io.ReadCloser if it is non-nil. Doing so will automatically close f. If there is an error f will be closed, the caller does not need to do so.
func GetZstdReadCloser ¶
func GetZstdReadCloser(zstd zstdimpl.ZstdImpl, f *os.File, expectedSize int64, offset int64) (io.ReadCloser, error)
Returns an io.ReadCloser that provides zstandard compressed data. The caller must close the returned io.ReadCloser if it is non-nil. Doing so will automatically close f. If there is an error f will be closed, the caller does not need to do so.
Types ¶
type CompressionType ¶
type CompressionType uint8
const ( Identity CompressionType = 0 Zstandard CompressionType = 1 )