sif

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImageIndexFromFileImage

func ImageIndexFromFileImage(fi *sif.FileImage) (v1.ImageIndex, error)

ImageIndexFromFileImage returns a v1.ImageIndex corresponding to f.

func Update added in v0.11.0

func Update(fi *sif.FileImage, ii v1.ImageIndex, opts ...UpdateOpt) error

Update modifies the SIF file associated with fi so that it holds the content of ImageIndex ii. Any blobs in the SIF that are not referenced in ii are removed from the SIF. Any blobs that are referenced in ii but not present in the SIF are added to the SIF. The RootIndex of the SIF is replaced with ii.

Update may create one or more temporary files during the update process. By default, the directory returned by os.TempDir is used. To override this, consider using OptUpdateTmpDir.

func Write

func Write(path string, ii v1.ImageIndex, opts ...WriteOpt) error

Write constructs a SIF at path from an ImageIndex.

By default, the SIF is created with the exact number of descriptors required to represent ii. To include spare descriptor capacity, consider using OptWriteWithSpareDescriptorCapacity.

Types

type Layer added in v0.7.0

type Layer struct {
	// contains filtered or unexported fields
}

func (*Layer) Compressed added in v0.7.0

func (l *Layer) Compressed() (io.ReadCloser, error)

Compressed returns an io.ReadCloser for the compressed layer contents.

func (*Layer) Descriptor added in v0.7.0

func (l *Layer) Descriptor() (*v1.Descriptor, error)

Descriptor returns the original descriptor from an image manifest. See partial.Descriptor.

func (*Layer) DiffID added in v0.7.0

func (l *Layer) DiffID() (v1.Hash, error)

DiffID returns the Hash of the uncompressed layer.

func (*Layer) Digest added in v0.7.0

func (l *Layer) Digest() (v1.Hash, error)

Digest returns the Hash of the compressed layer.

func (*Layer) MediaType added in v0.7.0

func (l *Layer) MediaType() (types.MediaType, error)

MediaType returns the media type of the Layer.

func (*Layer) Offset added in v0.7.0

func (l *Layer) Offset() (int64, error)

Offset returns the offset within the SIF image of the Layer.

func (*Layer) Size added in v0.7.0

func (l *Layer) Size() (int64, error)

Size returns the compressed size of the Layer.

func (*Layer) Uncompressed added in v0.7.0

func (l *Layer) Uncompressed() (io.ReadCloser, error)

Uncompressed returns an io.ReadCloser for the uncompressed layer contents.

type UpdateOpt added in v0.11.0

type UpdateOpt func(*updateOpts) error

UpdateOpt are used to specify options to apply when updating a SIF.

func OptUpdateTempDir added in v0.11.0

func OptUpdateTempDir(d string) UpdateOpt

OptUpdateTempDir sets the directory to use for temporary files. If not set, the directory returned by os.TempDir is used.

type WriteOpt added in v0.9.0

type WriteOpt func(*writeOpts) error

WriteOpt are used to specify write options.

func OptWriteWithSpareDescriptorCapacity added in v0.9.0

func OptWriteWithSpareDescriptorCapacity(n int64) WriteOpt

OptWriteWithSpareDescriptorCapacity specifies that the SIF should be created with n spare descriptors.

Jump to

Keyboard shortcuts

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