Documentation
¶
Overview ¶
Package imageio bridges v1.Image / v1.ImageIndex and the local filesystem: loading and saving tarballs (docker format) and OCI image layouts.
Index ¶
- Constants
- func LoadLocal(path string, asIndex bool) (partial.WithRawManifest, error)
- func LoadTarball(path, tag string) (v1.Image, error)
- func PullFormats() []string
- func SaveLegacy(path string, imgs map[string]v1.Image) error
- func SaveOCI(path string, imgs map[string]v1.Image, idxs map[string]v1.ImageIndex) error
- func SaveTarball(path string, imgs map[string]v1.Image) error
Constants ¶
const ( PullFormatTarball = "tarball" PullFormatLegacy = "legacy" PullFormatOCI = "oci" )
Pull output formats. Single source of truth - the cobra command (basic/pull.go) and the shell-completion enum (cmd/completion) both read from here.
Variables ¶
This section is empty.
Functions ¶
func LoadLocal ¶
func LoadLocal(path string, asIndex bool) (partial.WithRawManifest, error)
LoadLocal inspects path and returns a v1.Image or v1.ImageIndex.
path is a file -> docker tarball, returns v1.Image
path is an OCI layout -> contents determine the type:
- exactly one image manifest -> v1.Image
- exactly one nested index -> v1.ImageIndex (unwrapped, --index optional)
- several entries with asIndex = true -> v1.ImageIndex (the layout's top-level index)
- several entries without asIndex -> error (ambiguous)
func LoadTarball ¶
LoadTarball reads a docker-format tarball from path. When tag is non-empty it picks the matching manifest entry; otherwise the first/only entry.
func PullFormats ¶
func PullFormats() []string
PullFormats returns a defensive copy of the format enum suitable for cobra completion or help-text generation.
func SaveLegacy ¶
SaveLegacy writes imgs to path as a legacy docker-format tarball, which understands only tagged references (no digests) but is readable by old `docker load` versions. Empty maps are rejected for the same reason as SaveTarball.
func SaveOCI ¶
SaveOCI appends images and indices to an OCI image-layout directory at path, creating it if missing.
func SaveTarball ¶
SaveTarball writes imgs to path as a modern docker-compatible tarball (references may be digests or tagged names). An empty map is rejected: the resulting file would have no manifest.json and LoadTarball could not read it back, so callers see a clean error instead of a malformed artifact.
Types ¶
This section is empty.