ociutils

package
v0.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRegistryMatch

func CheckRegistryMatch(a, b string) error

func ExtractPathFromManifest

func ExtractPathFromManifest(mf *Manifest) (path string, isArchive bool, err error)

ExtractPathFromManifest returns the path information and whether the artifact contains an archive. The information is expected to be stored in the Manifest's annotations.

func IsDigest

func IsDigest(imageOrTag string) bool

IsDigest returns if the image is identified by a digest.

func NewCredentialsAggregate added in v0.5.0

func NewCredentialsAggregate(opts ...func(aggregate *CredFuncAggregate)) auth.CredentialFunc

NewCredentialsAggregate aggregates multiple auth.CredentialFunc into one function. Loads in the order they were added and returns an error if none are found.

func ParseOciImageString

func ParseOciImageString(r string) (repoName string, tag string, isDigest bool, err error)

ParseOciImageString splits the image string into the repo, tag and indicates if it is an image that is identified by a digest.

func ParseOciUrl

func ParseOciUrl(rawURL string) (*url.URL, error)

func WithCredFunc added in v0.5.0

func WithCredFunc(cf auth.CredentialFunc) func(*CredFuncAggregate)

Types

type CredFuncAggregate added in v0.5.0

type CredFuncAggregate struct {
	// contains filtered or unexported fields
}

type Manifest added in v0.8.0

type Manifest struct {
	specs.Versioned

	// MediaType specifies the type of this document data structure e.g. `application/vnd.oci.image.manifest.v1+json`
	MediaType string `json:"mediaType,omitempty"`

	// ArtifactType specifies the IANA media type of artifact when the manifest is used for an artifact.
	ArtifactType string `json:"artifactType,omitempty"`

	// Config references a configuration object for a container, by digest.
	// The referenced configuration object is a JSON blob that the runtime uses to set up the container.
	Config v1.Descriptor `json:"config"`

	// Layers is an indexed list of layers referenced by the manifest.
	Layers []v1.Descriptor `json:"layers"`

	// Blobs is an indexed list of blobs referenced by the manifest.
	Blobs []v1.Descriptor `json:"blobs"`

	// Subject is an optional link from the image manifest to another manifest forming an association between the image manifest and the other manifest.
	Subject *v1.Descriptor `json:"subject,omitempty"`

	// Annotations contains arbitrary metadata for the image manifest.
	Annotations map[string]string `json:"annotations,omitempty"`
}

Manifest provides `application/vnd.oci.image.manifest.v1+json` mediatype structure when marshalled to JSON.

func ParseManifestJSON

func ParseManifestJSON(data io.Reader) (*Manifest, error)

ParseManifestJSON return the Manifest that is yielded by the reader.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL