compression

package
v0.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 10 Imported by: 65

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 added in v0.10.0

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

func New added in v0.10.0

func New(t Type) Config

func (Config) SetForce added in v0.10.0

func (c Config) SetForce(v bool) Config

func (Config) SetLevel added in v0.10.0

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 added in v0.10.0

func FromMediaType(mediaType string) Type

func Parse added in v0.10.0

func Parse(t string) Type

func (Type) DefaultMediaType added in v0.10.0

func (ct Type) DefaultMediaType() string

func (Type) IsMediaType added in v0.10.0

func (ct Type) IsMediaType(mt string) bool

func (Type) String

func (ct Type) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL