Documentation
¶
Overview ¶
Package image consolidates knowledge about various container image formats (as opposed to image storage mechanisms, which are handled by types.ImageSource) and exposes all of them using an unified interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromSource ¶
func FromSource(src types.ImageSource) (types.Image, error)
FromSource returns a types.Image implementation for source. The caller must call .Close() on the returned Image.
FromSource “takes ownership” of the input ImageSource and will call src.Close() when the image is closed. (This does not prevent callers from using both the Image and ImageSource objects simultaneously, but it means that they only need to the Image.)
NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource, verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage instead of calling this function.
func FromUnparsedImage ¶
func FromUnparsedImage(unparsed *UnparsedImage) (types.Image, error)
FromUnparsedImage returns a types.Image implementation for unparsed. The caller must call .Close() on the returned Image.
FromSource “takes ownership” of the input UnparsedImage and will call uparsed.Close() when the image is closed. (This does not prevent callers from using both the UnparsedImage and ImageSource objects simultaneously, but it means that they only need to keep a reference to the Image.)
Types ¶
type UnparsedImage ¶
type UnparsedImage struct {
// contains filtered or unexported fields
}
UnparsedImage implements types.UnparsedImage .
func UnparsedFromSource ¶
func UnparsedFromSource(src types.ImageSource) *UnparsedImage
UnparsedFromSource returns a types.UnparsedImage implementation for source. The caller must call .Close() on the returned UnparsedImage.
UnparsedFromSource “takes ownership” of the input ImageSource and will call src.Close() when the image is closed. (This does not prevent callers from using both the UnparsedImage and ImageSource objects simultaneously, but it means that they only need to keep a reference to the UnparsedImage.)
func (*UnparsedImage) Close ¶
func (i *UnparsedImage) Close() error
Close removes resources associated with an initialized UnparsedImage, if any.
func (*UnparsedImage) Manifest ¶
func (i *UnparsedImage) Manifest() ([]byte, string, error)
Manifest is like ImageSource.GetManifest, but the result is cached; it is OK to call this however often you need.
func (*UnparsedImage) Reference ¶
func (i *UnparsedImage) Reference() types.ImageReference
Reference returns the reference used to set up this source, _as specified by the user_ (not as the image itself, or its underlying storage, claims). This can be used e.g. to determine which public keys are trusted for this image.
func (*UnparsedImage) Signatures ¶
func (i *UnparsedImage) Signatures(ctx context.Context) ([][]byte, error)
Signatures is like ImageSource.GetSignatures, but the result is cached; it is OK to call this however often you need.