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) (*types.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 Manifest
- type Opts
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 = types.MediaTypeDocker2Manifest // MediaTypeDocker2ManifestList is the media type when pulling a manifest list from a v2 registry MediaTypeDocker2ManifestList = types.MediaTypeDocker2ManifestList )
const ( // MediaTypeOCI1Manifest OCI v1 manifest media type MediaTypeOCI1Manifest = types.MediaTypeOCI1Manifest // MediaTypeOCI1ManifestList OCI v1 manifest list media type MediaTypeOCI1ManifestList = types.MediaTypeOCI1ManifestList )
Variables ¶
This section is empty.
Functions ¶
func GetMediaType ¶
GetMediaType returns the media type from the manifest descriptor
func GetPlatformDesc ¶
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 ¶
func OCIIndexToAny ¶
func OCIManifestFromAny ¶
func OCIManifestToAny ¶
Types ¶
type Manifest ¶
type Manifest interface { GetConfig() (types.Descriptor, error) GetDescriptor() types.Descriptor GetLayers() ([]types.Descriptor, error) GetManifestList() ([]types.Descriptor, error) GetOrig() interface{} GetRef() ref.Ref IsList() bool IsSet() bool MarshalJSON() ([]byte, error) RawBody() ([]byte, error) RawHeaders() (http.Header, error) SetOrig(interface{}) error GetConfigDigest() (digest.Digest, error) // TODO: deprecate GetDigest() digest.Digest // TODO: deprecate GetMediaType() string // TODO: deprecate GetPlatformDesc(p *platform.Platform) (*types.Descriptor, error) // TODO: deprecate GetPlatformList() ([]*platform.Platform, error) // TODO: deprecate GetRateLimit() types.RateLimit // TODO: deprecate HasRateLimit() bool // TODO: deprecate }
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 types.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