Documentation ¶
Overview ¶
Package tarfile is an internal implementation detail of some transports. Do not use outside of the github.com/containers/image repo!
Index ¶
- type Destination
- func (d *Destination) AcceptsForeignLayerURLs() bool
- func (d *Destination) Commit() error
- func (d *Destination) HasBlob(info types.BlobInfo) (bool, int64, error)
- func (d *Destination) MustMatchRuntimeOS() bool
- func (d *Destination) PutBlob(stream io.Reader, inputInfo types.BlobInfo) (types.BlobInfo, error)
- func (d *Destination) PutManifest(m []byte) error
- func (d *Destination) PutSignatures(signatures [][]byte) error
- func (d *Destination) ReapplyBlob(info types.BlobInfo) (types.BlobInfo, error)
- func (d *Destination) ShouldCompressLayers() bool
- func (d *Destination) SupportedManifestMIMETypes() []string
- func (d *Destination) SupportsSignatures() error
- type ManifestItem
- type Source
- func (s *Source) GetBlob(info types.BlobInfo) (io.ReadCloser, int64, error)
- func (s *Source) GetManifest(instanceDigest *digest.Digest) ([]byte, string, error)
- func (s *Source) GetSignatures(ctx context.Context, instanceDigest *digest.Digest) ([][]byte, error)
- func (s *Source) LoadTarManifest() ([]ManifestItem, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Destination ¶
type Destination struct {
// contains filtered or unexported fields
}
Destination is a partial implementation of types.ImageDestination for writing to an io.Writer.
func NewDestination ¶
func NewDestination(dest io.Writer, ref reference.NamedTagged) *Destination
NewDestination returns a tarfile.Destination for the specified io.Writer.
func (*Destination) AcceptsForeignLayerURLs ¶
func (d *Destination) AcceptsForeignLayerURLs() bool
AcceptsForeignLayerURLs returns false iff foreign layers in manifest should be actually uploaded to the image destination, true otherwise.
func (*Destination) Commit ¶
func (d *Destination) Commit() error
Commit finishes writing data to the underlying io.Writer. It is the caller's responsibility to close it, if necessary.
func (*Destination) HasBlob ¶
HasBlob returns true iff the image destination already contains a blob with the matching digest which can be reapplied using ReapplyBlob. Unlike PutBlob, the digest can not be empty. If HasBlob returns true, the size of the blob must also be returned. If the destination does not contain the blob, or it is unknown, HasBlob ordinarily returns (false, -1, nil); it returns a non-nil error only on an unexpected failure.
func (*Destination) MustMatchRuntimeOS ¶
func (d *Destination) MustMatchRuntimeOS() bool
MustMatchRuntimeOS returns true iff the destination can store only images targeted for the current runtime OS. False otherwise.
func (*Destination) PutBlob ¶
PutBlob writes contents of stream and returns data representing the result (with all data filled in). inputInfo.Digest can be optionally provided if known; it is not mandatory for the implementation to verify it. inputInfo.Size is the expected length of stream, if known. WARNING: The contents of stream are being verified on the fly. Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available to any other readers for download using the supplied digest. If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlob MUST 1) fail, and 2) delete any data stored so far.
func (*Destination) PutManifest ¶
func (d *Destination) PutManifest(m []byte) error
PutManifest writes manifest to the destination. FIXME? This should also receive a MIME type if known, to differentiate between schema versions. If the destination is in principle available, refuses this manifest type (e.g. it does not recognize the schema), but may accept a different manifest type, the returned error must be an ManifestTypeRejectedError.
func (*Destination) PutSignatures ¶
func (d *Destination) PutSignatures(signatures [][]byte) error
PutSignatures adds the given signatures to the docker tarfile (currently not supported). MUST be called after PutManifest (signatures reference manifest contents)
func (*Destination) ReapplyBlob ¶
ReapplyBlob informs the image destination that a blob for which HasBlob previously returned true would have been passed to PutBlob if it had returned false. Like HasBlob and unlike PutBlob, the digest can not be empty. If the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree.
func (*Destination) ShouldCompressLayers ¶
func (d *Destination) ShouldCompressLayers() bool
ShouldCompressLayers returns true iff it is desirable to compress layer blobs written to this destination.
func (*Destination) SupportedManifestMIMETypes ¶
func (d *Destination) SupportedManifestMIMETypes() []string
SupportedManifestMIMETypes tells which manifest mime types the destination supports If an empty slice or nil it's returned, then any mime type can be tried to upload
func (*Destination) SupportsSignatures ¶
func (d *Destination) SupportsSignatures() error
SupportsSignatures returns an error (to be displayed to the user) if the destination certainly can't store signatures. Note: It is still possible for PutSignatures to fail if SupportsSignatures returns nil.
type ManifestItem ¶
type ManifestItem struct { Config string RepoTags []string Layers []string Parent imageID `json:",omitempty"` LayerSources map[diffID]distributionDescriptor `json:",omitempty"` }
ManifestItem is an element of the array stored in the top-level manifest.json file.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is a partial implementation of types.ImageSource for reading from tarPath.
func (*Source) GetBlob ¶
GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown).
func (*Source) GetManifest ¶
GetManifest returns the image's manifest along with its MIME type (which may be empty when it can't be determined but the manifest is available). It may use a remote (= slow) service. If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists).
func (*Source) GetSignatures ¶
func (s *Source) GetSignatures(ctx context.Context, instanceDigest *digest.Digest) ([][]byte, error)
GetSignatures returns the image's signatures. It may use a remote (= slow) service. If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list (e.g. if the source never returns manifest lists).
func (*Source) LoadTarManifest ¶
func (s *Source) LoadTarManifest() ([]ManifestItem, error)
LoadTarManifest loads and decodes the manifest.json