Documentation ¶
Index ¶
- Variables
- func ImageIndexFromFileImage(fi *sif.FileImage) (v1.ImageIndex, error)deprecated
- func Update(fi *sif.FileImage, ii v1.ImageIndex, opts ...UpdateOpt) errordeprecated
- func Write(path string, ii v1.ImageIndex, opts ...WriteOpt) error
- type AppendOpt
- type Layer
- func (l *Layer) Compressed() (io.ReadCloser, error)
- func (l *Layer) Descriptor() (*v1.Descriptor, error)
- func (l *Layer) DiffID() (v1.Hash, error)
- func (l *Layer) Digest() (v1.Hash, error)
- func (l *Layer) MediaType() (types.MediaType, error)
- func (l *Layer) Offset() (int64, error)
- func (l *Layer) Size() (int64, error)
- func (l *Layer) Uncompressed() (io.ReadCloser, error)
- type OCIFileImage
- func (f *OCIFileImage) AppendImage(img v1.Image, opts ...AppendOpt) error
- func (f *OCIFileImage) AppendIndex(ii v1.ImageIndex, opts ...AppendOpt) error
- func (f *OCIFileImage) Blob(h v1.Hash) (io.ReadCloser, error)
- func (f *OCIFileImage) Bytes(h v1.Hash) ([]byte, error)
- func (f *OCIFileImage) FindManifests(m match.Matcher, _ ...Option) ([]v1.Descriptor, error)
- func (f *OCIFileImage) Image(m match.Matcher, _ ...Option) (v1.Image, error)
- func (f *OCIFileImage) Index(m match.Matcher, _ ...Option) (v1.ImageIndex, error)
- func (f *OCIFileImage) Offset(h v1.Hash) (int64, error)
- func (f *OCIFileImage) RemoveBlob(hash v1.Hash) error
- func (f *OCIFileImage) RemoveManifests(matcher match.Matcher) error
- func (f *OCIFileImage) ReplaceImage(img v1.Image, matcher match.Matcher, opts ...AppendOpt) error
- func (f *OCIFileImage) ReplaceIndex(ii v1.ImageIndex, matcher match.Matcher, opts ...AppendOpt) error
- func (f *OCIFileImage) RootIndex() (v1.ImageIndex, error)
- func (f *OCIFileImage) UpdateRootIndex(ii v1.ImageIndex, opts ...UpdateOpt) error
- func (f *OCIFileImage) WriteBlob(r io.Reader) error
- type Option
- type UpdateOpt
- type WriteOpt
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoMatch = errors.New("no match found") ErrMultipleMatches = errors.New("multiple matches found") )
Functions ¶
func ImageIndexFromFileImage
deprecated
func ImageIndexFromFileImage(fi *sif.FileImage) (v1.ImageIndex, error)
ImageIndexFromFileImage is a convenience function which constructs an OCIFileImage from a sif.FileImage, and returns its RootIndex as a v1.ImageIndex.
Deprecated: Use OCIFileImage.RootIndex instead. ImageIndexFromFileImage will be removed in a future version.
func Update
deprecated
added in
v0.11.0
func Write ¶
func Write(path string, ii v1.ImageIndex, opts ...WriteOpt) error
Write constructs a SIF at path from an ImageIndex, which becomes the RootIndex in the SIF.
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 AppendOpt ¶ added in v0.14.0
type AppendOpt func(*appendOpts) error
AppendOpt are used to specify options to apply when appending to a SIF.
func OptAppendReference ¶ added in v0.14.0
OptAppendReference sets the reference to be set for the appended item in the RootIndex. The reference is added as an `org.opencontainers.image.ref.name` in the RootIndex.
func OptAppendTempDir ¶ added in v0.14.0
OptAppendTempDir sets the directory to use for temporary files. If not set, the directory returned by os.TempDir is used.
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) Uncompressed ¶ added in v0.7.0
func (l *Layer) Uncompressed() (io.ReadCloser, error)
Uncompressed returns an io.ReadCloser for the uncompressed layer contents.
type OCIFileImage ¶ added in v0.14.0
type OCIFileImage struct {
// contains filtered or unexported fields
}
OCIFileImage represents a Singularity Image Format (SIF) file containing OCI artifacts.
func FromFileImage ¶ added in v0.14.0
func FromFileImage(fi *sif.FileImage) (*OCIFileImage, error)
FromFileImage constructs an extended oci-tools OCIFileImage, with OCI specific functionality, from a generic sif.FileImage.
func (*OCIFileImage) AppendImage ¶ added in v0.14.0
func (f *OCIFileImage) AppendImage(img v1.Image, opts ...AppendOpt) error
AppendImage appends an image to the SIF f, updating the RootIndex to reference it.
func (*OCIFileImage) AppendIndex ¶ added in v0.14.0
func (f *OCIFileImage) AppendIndex(ii v1.ImageIndex, opts ...AppendOpt) error
AppendIndex appends an index to the SIF f, updating the RootIndex to reference it.
func (*OCIFileImage) Blob ¶ added in v0.14.0
func (f *OCIFileImage) Blob(h v1.Hash) (io.ReadCloser, error)
Blob returns a ReadCloser that reads the blob with the supplied digest.
func (*OCIFileImage) Bytes ¶ added in v0.14.0
func (f *OCIFileImage) Bytes(h v1.Hash) ([]byte, error)
Bytes returns the bytes of the blob with the supplied digest.
func (*OCIFileImage) FindManifests ¶ added in v0.16.0
func (f *OCIFileImage) FindManifests(m match.Matcher, _ ...Option) ([]v1.Descriptor, error)
FindManifests finds the manifests stored in f that are selected by m. If m is nil, all manifests are selected.
func (*OCIFileImage) Image ¶ added in v0.14.0
Image returns a single Image stored in f, that is selected by m. If m is nil, all manifests are selected. If more than one image matches, an error wrapping ErrMultipleMatches is returned. If no image matches, an error wrapping ErrNoMatch is returned.
func (*OCIFileImage) Index ¶ added in v0.14.0
func (f *OCIFileImage) Index(m match.Matcher, _ ...Option) (v1.ImageIndex, error)
Index returns a single ImageIndex stored in f, that is selected by m. If m is nil, all manifests are selected. If more than one index matches, an error wrapping ErrMultipleMatches is returned. If no index matches, an error wrapping ErrNoMatch is returned.
func (*OCIFileImage) Offset ¶ added in v0.14.0
func (f *OCIFileImage) Offset(h v1.Hash) (int64, error)
Offset returns the offset within the SIF image of the blob with the supplied digest.
func (*OCIFileImage) RemoveBlob ¶ added in v0.14.0
func (f *OCIFileImage) RemoveBlob(hash v1.Hash) error
RemoveBlob removes a blob from the SIF f, without modifying the rootIndex.
func (*OCIFileImage) RemoveManifests ¶ added in v0.14.0
func (f *OCIFileImage) RemoveManifests(matcher match.Matcher) error
RemoveManifests modifies the SIF file associated with f so that its RootIndex no longer holds manifests selected by matcher. If m is nil, all manifests are selected. Any blobs in the SIF that are no longer referenced are removed from the SIF.
func (*OCIFileImage) ReplaceImage ¶ added in v0.14.0
ReplaceImage writes img to the SIF, replacing any existing manifest that is selected by the matcher. If m is nil, all manifests are selected. Any blobs in the SIF that are no longer referenced are removed from the SIF.
func (*OCIFileImage) ReplaceIndex ¶ added in v0.14.0
func (f *OCIFileImage) ReplaceIndex(ii v1.ImageIndex, matcher match.Matcher, opts ...AppendOpt) error
ReplaceIndex writes ii to the SIF, replacing any existing manifest that is selected by the matcher. If m is nil, all manifests are selected. Any blobs in the SIF that are no longer referenced are removed from the SIF.
func (*OCIFileImage) RootIndex ¶ added in v0.14.0
func (f *OCIFileImage) RootIndex() (v1.ImageIndex, error)
RootIndex returns the RootIndex of f as a v1.ImageIndex.
func (*OCIFileImage) UpdateRootIndex ¶ added in v0.14.0
func (f *OCIFileImage) UpdateRootIndex(ii v1.ImageIndex, opts ...UpdateOpt) error
UpdateRootIndex modifies the SIF file associated with f so that it holds the content of ImageIndex ii. The RootIndex of the SIF is replaced with 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.
UpdateRootIndex 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.
type Option ¶ added in v0.14.0
type Option func(*options) error
Option is a functional option for OCIFileImage operations.
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
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
OptWriteWithSpareDescriptorCapacity specifies that the SIF should be created with n spare descriptors.