package compression

import "github.com/moby/buildkit/util/compression"

Index

Variables

var Default = Gzip

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.

Types

type Config

type Config struct {
	Type  Type
	Force bool
	Level *int
}

func New

func New(t Type) Config

func (Config) SetForce

func (c Config) SetForce(v bool) Config

func (Config) SetLevel

func (c Config) SetLevel(l int) Config

type Type

type Type int

Type represents compression type for blob data.

const (
	// Uncompressed indicates no compression.
	Uncompressed Type = iota

	// Gzip is used for blob data.
	Gzip

	// EStargz is used for estargz data.
	EStargz

	// Zstd is used for Zstandard data.
	Zstd

	// UnknownCompression means not supported yet.
	UnknownCompression Type = -1
)

func FromMediaType

func FromMediaType(mediaType string) Type

func Parse

func Parse(t string) Type

func (Type) DefaultMediaType

func (ct Type) DefaultMediaType() string

func (Type) IsMediaType

func (ct Type) IsMediaType(mt string) bool

func (Type) String

func (ct Type) String() string

Source Files

compression.go

Version
v0.10.4
Published
Aug 22, 2022
Platform
js/wasm
Imports
10 packages
Last checked
12 hours ago

Tools for package owners.