package externaltoc

import "github.com/containerd/stargz-snapshotter/estargz/externaltoc"

Index

Constants

const FooterSize = 46

The footer is an empty gzip stream with no compression and an Extra header.

46 comes from:

10 bytes gzip header 2 bytes XLEN (length of Extra field) = 21 (4 bytes header + len("STARGZEXTERNALTOC")) 2 bytes Extra: SI1 = 'S', SI2 = 'G' 2 bytes Extra: LEN = 17 (len("STARGZEXTERNALTOC")) 17 bytes Extra: subfield = "STARGZEXTERNALTOC" 5 bytes flate header 8 bytes gzip footer (End of the eStargz blob)

Functions

func NewGzipCompressionWithLevel

func NewGzipCompressionWithLevel(provideTOC func() ([]byte, error), level int) estargz.Compression

Types

type GzipCompression

type GzipCompression struct {
	*GzipCompressor
	*GzipDecompressor
}

type GzipCompressor

type GzipCompressor struct {
	// contains filtered or unexported fields
}

func NewGzipCompressor

func NewGzipCompressor() *GzipCompressor

func NewGzipCompressorWithLevel

func NewGzipCompressorWithLevel(level int) *GzipCompressor

func (*GzipCompressor) WriteTOCAndFooter

func (gc *GzipCompressor) WriteTOCAndFooter(w io.Writer, off int64, toc *estargz.JTOC, diffHash hash.Hash) (digest.Digest, error)

func (*GzipCompressor) WriteTOCTo

func (gc *GzipCompressor) WriteTOCTo(w io.Writer) (int, error)

func (*GzipCompressor) Writer

type GzipDecompressor

type GzipDecompressor struct {
	// contains filtered or unexported fields
}

func NewGzipDecompressor

func NewGzipDecompressor(provideTOCFunc func() ([]byte, error)) *GzipDecompressor

func (*GzipDecompressor) DecompressTOC

func (gz *GzipDecompressor) DecompressTOC(r io.Reader) (tocJSON io.ReadCloser, err error)

func (*GzipDecompressor) FooterSize

func (gz *GzipDecompressor) FooterSize() int64

func (*GzipDecompressor) ParseFooter

func (gz *GzipDecompressor) ParseFooter(p []byte) (blobPayloadSize, tocOffset, tocSize int64, err error)

func (*GzipDecompressor) ParseTOC

func (gz *GzipDecompressor) ParseTOC(r io.Reader) (toc *estargz.JTOC, tocDgst digest.Digest, err error)

func (*GzipDecompressor) Reader

func (gz *GzipDecompressor) Reader(r io.Reader) (io.ReadCloser, error)

Source Files

externaltoc.go

Version
v0.16.3 (latest)
Published
Dec 12, 2024
Platform
js/wasm
Imports
11 packages
Last checked
10 months ago

Tools for package owners.