Documentation
¶
Index ¶
- func BlobInfoFromImage(ctx context.Context, sysCtx *types.SystemContext, img types.Image) ([]types.BlobInfo, error)
- func FormatDigest(digest digest.Digest, fullDigest bool) string
- func HumanReadableSize(b int64) string
- func ImageAndLayersFromURI(ctx context.Context, sysCtx *types.SystemContext, uri string) (types.Image, []storage.Layer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlobInfoFromImage ¶
func BlobInfoFromImage(ctx context.Context, sysCtx *types.SystemContext, img types.Image) ([]types.BlobInfo, error)
BlobInfoFromImage extracts layer blob information that can be later used with `GetBlob` from a container image, handling different transport types appropriately.
Returns a slice of BlobInfo containing layer information needed for blob retrieval operations.
func FormatDigest ¶
FormatDigest returns either the digest if `fullDigest` is `true` or the first twelve characters of the hash/encoded value if `fullDigest` is `false`.
func HumanReadableSize ¶
HumanReadableSize converts a byte count to a human readable string From https://yourbasic.org/golang/formatting-byte-size-to-human-readable-format/
func ImageAndLayersFromURI ¶
func ImageAndLayersFromURI(ctx context.Context, sysCtx *types.SystemContext, uri string) (types.Image, []storage.Layer, error)
ImageAndLayersFromURI tries to obtain the image from the "most likely source"
If the uri includes a transport, then the uri is parsed and an Image instance is returned.
If the uri does not contain a transport, then this function first tries to load the image from the (rootless) container storage. If that fails, we try to load it from a registry by prepending the `docker://` transport.
If the image is present in the local container store, then we also return the layers of that image.
Types ¶
This section is empty.