package compression
import "github.com/moby/buildkit/util/compression"
Index ¶
- Variables
- func ConvertAllLayerMediaTypes(ctx context.Context, 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 ParseAttributes(attrs map[string]string) (Config, error)
- 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 = Gzip
var EStargzAnnotations = []string{estargz.TOCJSONDigestAnnotation, estargz.StoreUncompressedSizeAnnotation}
Functions ¶
func ConvertAllLayerMediaTypes ¶
func ConvertAllLayerMediaTypes(ctx context.Context, 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 ParseAttributes ¶
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(comp Config) bool OnlySupportOCITypes() 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 ¶
attrs.go compression.go estargz.go gzip.go parse.go uncompressed.go zstd.go
- Version
- v0.21.0 (latest)
- Published
- Apr 11, 2025
- Platform
- linux/amd64
- Imports
- 19 packages
- Last checked
- 2 days ago –
Tools for package owners.