func RefMatcher(ref name.Reference) match.Matcher
RefMatcher returns a matcher for looking up the OCI v1 annotation used to look up tagged artifacts
Path represents an OCI Image Layout on disk. It is used for storing and accessing packages locally.
type Path struct { layout.Path }
func Clear(path string) (*Path, error)
func FromFS(fsys fs.FS, dst string) (*Path, error)
FromFS reads an Image Layout from the root of fsys. If a layout exists at another location in the file system, fs.Sub can be used to create an appropriate FS:
f, err := fs.Sub(embeddedFSVar, "layout/root") if err != nil { return err } p, err := layout.FromFS(f)
func New(path string) (*Path, error)
New creates a new Path at the specified filepath. If an Image Layout doesn't already exist at that path, a new one is created.
func (p *Path) Append(ref name.Reference, a oci.Artifact) error
Append adds the artifact to the image layout with correct warehouse annotations for fetching based on the name and tag.
func (p *Path) Get(ref name.Reference) (oci.Artifact, error)
Get retrieves an OCI artifact from the layout for the ref, based on what kind of ref it is. If the ref is a name.Tag, it is looked up using the OCI reference annotation defined in the OCI Image spec. If it is a name.Digest, the digest is searched for directly.
func (p *Path) Prune() ([]string, error)
func (p *Path) Sort() error
Sort improves the reproducibility of the layout's IndexManifest (index.json) by sorting the descriptors by digest. The initial index is read in as a GGCR v1.IndexManifest. Its descriptors are then sorted by digest. The modified index is written back to the same location.