package compression
import "github.com/moby/buildkit/util/compression"
Index ¶
- Variables
- func ConvertAllLayerMediaTypes(oci bool, descs ...ocispecs.Descriptor) []ocispecs.Descriptor
- func DetectLayerMediaType(ctx context.Context, cs content.Store, id digest.Digest, oci bool) (string, error)
- func IsMediaType(ct Type, mt string) bool
- type Compressor
- type Config
- func New(t Type) Config
- func (c Config) SetForce(v bool) Config
- func (c Config) SetLevel(l int) Config
- type Decompressor
- type Finalizer
- type Type
Variables ¶
var ( // Uncompressed indicates no compression. Uncompressed = uncompressedType{} // Gzip is used for blob data. Gzip = gzipType{} // EStargz is used for estargz data. EStargz = estargzType{} // Zstd is used for Zstandard data. Zstd = zstdType{} )
var Default gzipType = Gzip
var EStargzAnnotations = []string{estargz.TOCJSONDigestAnnotation, estargz.StoreUncompressedSizeAnnotation}
Functions ¶
func ConvertAllLayerMediaTypes ¶
func ConvertAllLayerMediaTypes(oci bool, descs ...ocispecs.Descriptor) []ocispecs.Descriptor
func DetectLayerMediaType ¶
func DetectLayerMediaType(ctx context.Context, cs content.Store, id digest.Digest, oci bool) (string, error)
DetectLayerMediaType returns media type from existing blob data.
func IsMediaType ¶
Types ¶
type Compressor ¶
type Config ¶
func New ¶
func (Config) SetForce ¶
func (Config) SetLevel ¶
type Decompressor ¶
type Decompressor func(ctx context.Context, cs content.Store, desc ocispecs.Descriptor) (io.ReadCloser, error)
type Finalizer ¶
type Type ¶
type Type interface { Compress(ctx context.Context, comp Config) (compressorFunc Compressor, finalize Finalizer) Decompress(ctx context.Context, cs content.Store, desc ocispecs.Descriptor) (io.ReadCloser, error) NeedsConversion(ctx context.Context, cs content.Store, desc ocispecs.Descriptor) (bool, error) NeedsComputeDiffBySelf() bool OnlySupportOCITypes() bool NeedsForceCompression() bool MediaType() string String() string }
Type represents compression type for blob data, which needs to be implemented for each compression type.
func FromMediaType ¶
func Parse ¶
Source Files ¶
compression.go estargz.go gzip.go parse.go uncompressed.go zstd.go
- Version
- v0.11.6
- Published
- Apr 20, 2023
- Platform
- js/wasm
- Imports
- 19 packages
- Last checked
- 12 hours ago –
Tools for package owners.