package blobs

import "github.com/moby/buildkit/cache/blobs"

Index

Variables

var DefaultCompression = Gzip
var ErrNoBlobs = errors.Errorf("no blobs for snapshot")

Functions

func DetectLayerMediaType

func DetectLayerMediaType(ctx context.Context, cs content.Store, id digest.Digest, oci bool) (string, error)

DetectCompressionType returns media type from existing blob data.

func GetMediaTypeForLayers

func GetMediaTypeForLayers(diffPairs []DiffPair, ref cache.ImmutableRef) []string

GetMediaTypeForLayers retrieves media type for layer from ref information.

Types

type CompareWithParent

type CompareWithParent interface {
	CompareWithParent(ctx context.Context, ref string, opts ...diff.Opt) (ocispec.Descriptor, error)
}

type CompressionType

type CompressionType int

CompressionType represents compression type for blob data.

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

	// Gzip is used for blob data.
	Gzip

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

func (CompressionType) String

func (ct CompressionType) String() string

type DiffPair

type DiffPair struct {
	DiffID  digest.Digest
	Blobsum digest.Digest
}

func GetDiffPairs

func GetDiffPairs(ctx context.Context, contentStore content.Store, differ diff.Comparer, ref cache.ImmutableRef, createBlobs bool, compression CompressionType) ([]DiffPair, error)

GetDiffPairs returns the DiffID/Blobsum pairs for a giver reference and saves it. Caller must hold a lease when calling this function.

Source Files

blobs.go compression.go

Version
v0.7.1
Published
Apr 16, 2020
Platform
js/wasm
Imports
15 packages
Last checked
12 hours ago

Tools for package owners.