Documentation ¶
Overview ¶
Package partial defines methods for building up a v1.Image from minimal subsets that are sufficient for defining a v1.Image.
Index ¶
- func BlobDescriptor(i WithManifest, h v1.Hash) (*v1.Descriptor, error)
- func BlobSize(i WithManifest, h v1.Hash) (int64, error)
- func BlobToDiffID(i WithManifestAndConfigFile, h v1.Hash) (v1.Hash, error)
- func CompressedToImage(cic CompressedImageCore) (v1.Image, error)
- func CompressedToLayer(ul CompressedLayer) (v1.Layer, error)
- func ConfigFile(i WithRawConfigFile) (*v1.ConfigFile, error)
- func ConfigLayer(i WithRawConfigFile) (v1.Layer, error)
- func ConfigName(i WithRawConfigFile) (v1.Hash, error)
- func Descriptor(d Describable) (*v1.Descriptor, error)
- func DiffIDToBlob(wm WithManifestAndConfigFile, h v1.Hash) (v1.Hash, error)
- func DiffIDs(i WithConfigFile) ([]v1.Hash, error)
- func Digest(i WithRawManifest) (v1.Hash, error)
- func FSLayers(i WithManifest) ([]v1.Hash, error)
- func Manifest(i WithRawManifest) (*v1.Manifest, error)
- func RawConfigFile(i WithConfigFile) ([]byte, error)
- func RawManifest(i WithManifest) ([]byte, error)
- func Size(i WithRawManifest) (int64, error)
- func UncompressedSize(l v1.Layer) (int64, error)
- func UncompressedToImage(uic UncompressedImageCore) (v1.Image, error)
- func UncompressedToLayer(ul UncompressedLayer) (v1.Layer, error)
- type CompressedImageCore
- type CompressedLayer
- type Describable
- type ImageCore
- type UncompressedImageCore
- type UncompressedLayer
- type WithConfigFile
- type WithDiffID
- type WithManifest
- type WithManifestAndConfigFile
- type WithRawConfigFile
- type WithRawManifest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlobDescriptor ¶
func BlobDescriptor(i WithManifest, h v1.Hash) (*v1.Descriptor, error)
BlobDescriptor is a helper for implementing v1.Image
func BlobSize ¶
func BlobSize(i WithManifest, h v1.Hash) (int64, error)
BlobSize is a helper for implementing v1.Image
func BlobToDiffID ¶
BlobToDiffID is a helper for mapping between compressed and uncompressed blob hashes.
func CompressedToImage ¶
func CompressedToImage(cic CompressedImageCore) (v1.Image, error)
CompressedToImage fills in the missing methods from a CompressedImageCore so that it implements v1.Image
func CompressedToLayer ¶
func CompressedToLayer(ul CompressedLayer) (v1.Layer, error)
CompressedToLayer fills in the missing methods from a CompressedLayer so that it implements v1.Layer
func ConfigFile ¶
func ConfigFile(i WithRawConfigFile) (*v1.ConfigFile, error)
ConfigFile is a helper for implementing v1.Image
func ConfigLayer ¶
func ConfigLayer(i WithRawConfigFile) (v1.Layer, error)
ConfigLayer implements v1.Layer from the raw config bytes. This is so that clients (e.g. remote) can access the config as a blob.
func ConfigName ¶
func ConfigName(i WithRawConfigFile) (v1.Hash, error)
ConfigName is a helper for implementing v1.Image
func Descriptor ¶
func Descriptor(d Describable) (*v1.Descriptor, error)
Descriptor returns a v1.Descriptor given a Describable. It also encodes some logic for unwrapping things that have been wrapped by CompressedToLayer, UncompressedToLayer, CompressedToImage, or UncompressedToImage.
func DiffIDToBlob ¶
DiffIDToBlob is a helper for mapping between uncompressed and compressed blob hashes.
func DiffIDs ¶
func DiffIDs(i WithConfigFile) ([]v1.Hash, error)
DiffIDs is a helper for implementing v1.Image
func Digest ¶
func Digest(i WithRawManifest) (v1.Hash, error)
Digest is a helper for implementing v1.Image
func FSLayers ¶
func FSLayers(i WithManifest) ([]v1.Hash, error)
FSLayers is a helper for implementing v1.Image
func Manifest ¶
func Manifest(i WithRawManifest) (*v1.Manifest, error)
Manifest is a helper for implementing v1.Image
func RawConfigFile ¶
func RawConfigFile(i WithConfigFile) ([]byte, error)
RawConfigFile is a helper for implementing v1.Image
func RawManifest ¶
func RawManifest(i WithManifest) ([]byte, error)
RawManifest is a helper for implementing v1.Image
func UncompressedSize ¶
UncompressedSize returns the size of the Uncompressed layer. If the underlying implementation doesn't implement UncompressedSize directly, this will compute the uncompressedSize by reading everything returned by Compressed(). This is potentially expensive and may consume the contents for streaming layers.
func UncompressedToImage ¶
func UncompressedToImage(uic UncompressedImageCore) (v1.Image, error)
UncompressedToImage fills in the missing methods from an UncompressedImageCore so that it implements v1.Image.
func UncompressedToLayer ¶
func UncompressedToLayer(ul UncompressedLayer) (v1.Layer, error)
UncompressedToLayer fills in the missing methods from an UncompressedLayer so that it implements v1.Layer
Types ¶
type CompressedImageCore ¶
type CompressedImageCore interface { ImageCore // RawManifest returns the serialized bytes of the manifest. RawManifest() ([]byte, error) // LayerByDigest is a variation on the v1.Image method, which returns // a CompressedLayer instead. LayerByDigest(v1.Hash) (CompressedLayer, error) }
CompressedImageCore represents the base minimum interface a natively compressed image must implement for us to produce a v1.Image.
type CompressedLayer ¶
type CompressedLayer interface { // Digest returns the Hash of the compressed layer. Digest() (v1.Hash, error) // Compressed returns an io.ReadCloser for the compressed layer contents. Compressed() (io.ReadCloser, error) // Size returns the compressed size of the Layer. Size() (int64, error) // Returns the mediaType for the compressed Layer MediaType() (types.MediaType, error) }
CompressedLayer represents the bare minimum interface a natively compressed layer must implement for us to produce a v1.Layer
type Describable ¶
type Describable interface { Digest() (v1.Hash, error) MediaType() (types.MediaType, error) Size() (int64, error) }
Describable represents something for which we can produce a v1.Descriptor.
type ImageCore ¶
type ImageCore interface { // RawConfigFile returns the serialized bytes of this image's config file. RawConfigFile() ([]byte, error) // MediaType of this image's manifest. MediaType() (types.MediaType, error) }
ImageCore is the core set of properties without which we cannot build a v1.Image
type UncompressedImageCore ¶
type UncompressedImageCore interface { ImageCore // LayerByDiffID is a variation on the v1.Image method, which returns // an UncompressedLayer instead. LayerByDiffID(v1.Hash) (UncompressedLayer, error) }
UncompressedImageCore represents the bare minimum interface a natively uncompressed image must implement for us to produce a v1.Image
type UncompressedLayer ¶
type UncompressedLayer interface { // DiffID returns the Hash of the uncompressed layer. DiffID() (v1.Hash, error) // Uncompressed returns an io.ReadCloser for the uncompressed layer contents. Uncompressed() (io.ReadCloser, error) // Returns the mediaType for the compressed Layer MediaType() (types.MediaType, error) }
UncompressedLayer represents the bare minimum interface a natively uncompressed layer must implement for us to produce a v1.Layer
type WithConfigFile ¶
type WithConfigFile interface { // ConfigFile returns this image's config file. ConfigFile() (*v1.ConfigFile, error) }
WithConfigFile defines the subset of v1.Image used by these helper methods
type WithDiffID ¶
WithDiffID defines the subset of v1.Layer for exposing the DiffID method.
type WithManifest ¶
type WithManifest interface { // Manifest returns this image's Manifest object. Manifest() (*v1.Manifest, error) }
WithManifest defines the subset of v1.Image used by these helper methods
type WithManifestAndConfigFile ¶
type WithManifestAndConfigFile interface { WithConfigFile // Manifest returns this image's Manifest object. Manifest() (*v1.Manifest, error) }
WithManifestAndConfigFile defines the subset of v1.Image used by these helper methods
type WithRawConfigFile ¶
type WithRawConfigFile interface { // RawConfigFile returns the serialized bytes of this image's config file. RawConfigFile() ([]byte, error) }
WithRawConfigFile defines the subset of v1.Image used by these helper methods
type WithRawManifest ¶
type WithRawManifest interface { // RawManifest returns the serialized bytes of this image's config file. RawManifest() ([]byte, error) }
WithRawManifest defines the subset of v1.Image used by these helper methods