Documentation ¶
Overview ¶
Package manifest abstracts the various types of supported manifests. Supported types include OCI index and image, and Docker manifest list and manifest.
Index ¶
- Constants
- func GetDigest(m Manifest) digest.Digest
- func GetMediaType(m Manifest) string
- func GetPlatformDesc(m Manifest, p *platform.Platform) (*descriptor.Descriptor, error)
- func GetPlatformList(m Manifest) ([]*platform.Platform, error)
- func GetRateLimit(m Manifest) types.RateLimit
- func HasRateLimit(m Manifest) bool
- func OCIIndexFromAny(orig interface{}) (v1.Index, error)
- func OCIIndexToAny(ociI v1.Index, origP interface{}) error
- func OCIManifestFromAny(orig interface{}) (v1.Manifest, error)
- func OCIManifestToAny(ociM v1.Manifest, origP interface{}) error
- type Annotator
- type Imager
- type Indexer
- type Manifest
- type Opts
- type Subjecter
Constants ¶
const ( // MediaTypeDocker1Manifest deprecated media type for docker schema1 manifests. MediaTypeDocker1Manifest = "application/vnd.docker.distribution.manifest.v1+json" // MediaTypeDocker1ManifestSigned is a deprecated schema1 manifest with jws signing. MediaTypeDocker1ManifestSigned = "application/vnd.docker.distribution.manifest.v1+prettyjws" )
const ( // MediaTypeDocker2Manifest is the media type when pulling manifests from a v2 registry MediaTypeDocker2Manifest = mediatype.Docker2Manifest // MediaTypeDocker2ManifestList is the media type when pulling a manifest list from a v2 registry MediaTypeDocker2ManifestList = mediatype.Docker2ManifestList )
const ( // MediaTypeOCI1Manifest OCI v1 manifest media type MediaTypeOCI1Manifest = mediatype.OCI1Manifest // MediaTypeOCI1ManifestList OCI v1 manifest list media type MediaTypeOCI1ManifestList = mediatype.OCI1ManifestList )
Variables ¶
This section is empty.
Functions ¶
func GetMediaType ¶
GetMediaType returns the media type from the manifest descriptor.
func GetPlatformDesc ¶
func GetPlatformDesc(m Manifest, p *platform.Platform) (*descriptor.Descriptor, error)
GetPlatformDesc returns the descriptor for a specific platform from an index.
func GetPlatformList ¶
GetPlatformList returns the list of platforms from an index.
func GetRateLimit ¶
GetRateLimit returns the current rate limit seen in headers.
func HasRateLimit ¶
HasRateLimit indicates whether the rate limit is set and available.
func OCIIndexFromAny ¶
OCIIndexFromAny converts manifest lists to an OCI index.
func OCIIndexToAny ¶
OCIIndexToAny converts from an OCI index back to the manifest list.
func OCIManifestFromAny ¶
OCIManifestFromAny converts an image manifest to an OCI manifest.
func OCIManifestToAny ¶
OCIManifestToAny converts an OCI manifest back to the image manifest.
Types ¶
type Annotator ¶ added in v0.4.3
type Annotator interface { GetAnnotations() (map[string]string, error) SetAnnotation(key, val string) error }
Annotator is used by manifests that support annotations. Note this will work for Docker manifests despite the spec not officially supporting it.
type Imager ¶ added in v0.4.4
type Imager interface { GetConfig() (descriptor.Descriptor, error) GetLayers() ([]descriptor.Descriptor, error) SetConfig(d descriptor.Descriptor) error SetLayers(dl []descriptor.Descriptor) error GetSize() (int64, error) }
Imager is used by manifests packaging an image.
type Indexer ¶ added in v0.4.4
type Indexer interface { GetManifestList() ([]descriptor.Descriptor, error) SetManifestList(dl []descriptor.Descriptor) error }
Indexer is used by manifests that contain a manifest list.
type Manifest ¶
type Manifest interface { GetDescriptor() descriptor.Descriptor GetOrig() interface{} GetRef() ref.Ref IsList() bool IsSet() bool MarshalJSON() ([]byte, error) RawBody() ([]byte, error) RawHeaders() (http.Header, error) SetOrig(interface{}) error // Deprecated: GetConfig should be accessed using [Imager] interface. GetConfig() (descriptor.Descriptor, error) // Deprecated: GetLayers should be accessed using [Imager] interface. GetLayers() ([]descriptor.Descriptor, error) // Deprecated: GetManifestList should be accessed using [Indexer] interface. GetManifestList() ([]descriptor.Descriptor, error) // Deprecated: GetConfigDigest should be replaced with [GetConfig]. GetConfigDigest() (digest.Digest, error) // Deprecated: GetDigest should be replaced with GetDescriptor().Digest, see [GetDescriptor]. GetDigest() digest.Digest // Deprecated: GetMediaType should be replaced with GetDescriptor().MediaType, see [GetDescriptor]. GetMediaType() string // Deprecated: GetPlatformDesc method should be replaced with [manifest.GetPlatformDesc]. GetPlatformDesc(p *platform.Platform) (*descriptor.Descriptor, error) // Deprecated: GetPlatformList method should be replaced with [manifest.GetPlatformList]. GetPlatformList() ([]*platform.Platform, error) // Deprecated: GetRateLimit method should be replaced with [manifest.GetRateLimit]. GetRateLimit() types.RateLimit // Deprecated: HasRateLimit method should be replaced with [manifest.HasRateLimit]. HasRateLimit() bool }
Manifest interface is implemented by all supported manifests but many calls are only supported by certain underlying media types.
type Opts ¶
type Opts func(*manifestConfig)
func WithDesc ¶
func WithDesc(desc descriptor.Descriptor) Opts
WithDesc specifies the descriptor for the manifest.
func WithHeader ¶
WithHeader provides the headers from the response when pulling the manifest.
func WithOrig ¶
func WithOrig(orig interface{}) Opts
WithOrig provides the original manifest variable.
type Subjecter ¶ added in v0.4.5
type Subjecter interface { GetSubject() (*descriptor.Descriptor, error) SetSubject(d *descriptor.Descriptor) error }
Subjecter is used by manifests that may have a subject field.