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 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 = 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 Imager ¶ added in v0.4.4
type Imager interface { GetConfig() (types.Descriptor, error) GetLayers() ([]types.Descriptor, error) SetConfig(d types.Descriptor) error SetLayers(dl []types.Descriptor) error }
type Indexer ¶ added in v0.4.4
type Indexer interface { GetManifestList() ([]types.Descriptor, error) SetManifestList(dl []types.Descriptor) error }
type Manifest ¶
type Manifest interface { GetDescriptor() types.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() (types.Descriptor, error) // Deprecated: GetLayers should be accessed using Imager interface GetLayers() ([]types.Descriptor, error) // Deprecated: GetManifestList should be accessed using Indexer interface GetManifestList() ([]types.Descriptor, error) // Deprecated: GetConfigDigest should be replaced with GetConfig GetConfigDigest() (digest.Digest, error) // Deprecated: GetDigest should be replaced with GetDescriptor().Digest GetDigest() digest.Digest // Deprecated: GetMediaType should be replaced with GetDescriptor().MediaType GetMediaType() string // Deprecated: GetPlatformDesc method should be replaced with manifest.GetPlatformDesc function GetPlatformDesc(p *platform.Platform) (*types.Descriptor, error) // Deprecated: GetPlatformList method should be replaced with manifest.GetPlatformList function GetPlatformList() ([]*platform.Platform, error) // Deprecated: GetRateLimit method should be replaced with manifest.GetRateLimit function GetRateLimit() types.RateLimit // Deprecated: HasRateLimit method should be replaced with manifest.HasRateLimit function 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 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
type Subjecter ¶ added in v0.4.5
type Subjecter interface { GetSubject() (*types.Descriptor, error) SetSubject(d *types.Descriptor) error }