...

Package zstdchunked

import "github.com/containerd/stargz-snapshotter/estargz/zstdchunked"
Overview
Index

Overview ▾

Constants

const (
    // ManifestChecksumAnnotation is an annotation that contains the compressed TOC Digset
    ManifestChecksumAnnotation = "io.containers.zstd-chunked.manifest-checksum"

    // ManifestPositionAnnotation is an annotation that contains the offset to the TOC.
    ManifestPositionAnnotation = "io.containers.zstd-chunked.manifest-position"

    // FooterSize is the size of the footer
    FooterSize = 40
)

type Compressor

type Compressor struct {
    CompressionLevel zstd.EncoderLevel
    Metadata         map[string]string
    // contains filtered or unexported fields
}

func (*Compressor) WriteTOCAndFooter

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

func (*Compressor) Writer

func (zc *Compressor) Writer(w io.Writer) (estargz.WriteFlushCloser, error)

type Decompressor

type Decompressor struct{}

func (*Decompressor) DecompressTOC

func (zz *Decompressor) DecompressTOC(r io.Reader) (tocJSON io.ReadCloser, err error)

func (*Decompressor) FooterSize

func (zz *Decompressor) FooterSize() int64

func (*Decompressor) ParseFooter

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

func (*Decompressor) ParseTOC

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

func (*Decompressor) Reader

func (zz *Decompressor) Reader(r io.Reader) (io.ReadCloser, error)