artdesc

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MediaTypeImageManifest  = ociv1.MediaTypeImageManifest
	MediaTypeImageIndex     = ociv1.MediaTypeImageIndex
	MediaTypeImageLayer     = ociv1.MediaTypeImageLayer
	MediaTypeImageLayerGzip = ociv1.MediaTypeImageLayerGzip

	MediaTypeDockerSchema2Manifest     = images.MediaTypeDockerSchema2Manifest
	MediaTypeDockerSchema2ManifestList = images.MediaTypeDockerSchema2ManifestList

	MediaTypeImageConfig = ociv1.MediaTypeImageConfig
)
View Source
const SchemeVersion = helper.SchemeVersion

Variables

This section is empty.

Functions

func ArchiveBlobTypes

func ArchiveBlobTypes() []string

func ArtifactMimeType

func ArtifactMimeType(cur, def string, legacy bool) string

func ContentTypes

func ContentTypes() []string

func DescriptorTypes

func DescriptorTypes() []string

func Encode

func Encode(d *Artifact) ([]byte, error)

func EncodeIndex

func EncodeIndex(d *Index) ([]byte, error)

func EncodeManifest

func EncodeManifest(d *Manifest) ([]byte, error)

func IsDigest

func IsDigest(version string) (bool, digest.Digest)

func IsOCIMediaType

func IsOCIMediaType(media string) bool

func MapArtifactBlobMimeType

func MapArtifactBlobMimeType(blob blobaccess.BlobAccess, legacy bool) blobaccess.BlobAccess

func MapArtifactMimeType

func MapArtifactMimeType(mime string, legacy bool) string

func ToArchiveMediaTypes added in v0.3.0

func ToArchiveMediaTypes(media string) []string

func ToContentMediaType

func ToContentMediaType(media string) string

func ToDescriptorMediaType

func ToDescriptorMediaType(media string) string

Types

type Artifact

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

Artifact is the unified representation of an OCI artifact according to https://github.com/opencontainers/image-spec/blob/main/manifest.md It is either an image manifest or an image index manifest (fat image).

func Decode

func Decode(data []byte) (*Artifact, error)

func New

func New() *Artifact

func NewIndexArtifact

func NewIndexArtifact() *Artifact

func NewManifestArtifact

func NewManifestArtifact() *Artifact

func (*Artifact) Artifact added in v0.7.0

func (d *Artifact) Artifact() *Artifact

func (*Artifact) Blob added in v0.7.0

func (d *Artifact) Blob() (blobaccess.BlobAccess, error)

func (*Artifact) DeleteAnnotation added in v0.4.1

func (d *Artifact) DeleteAnnotation(name string) error

func (*Artifact) Digest added in v0.7.0

func (d *Artifact) Digest() digest.Digest

func (*Artifact) GetAnnotation added in v0.7.0

func (d *Artifact) GetAnnotation(name string) string

func (*Artifact) GetBlobDescriptor

func (d *Artifact) GetBlobDescriptor(digest digest.Digest) *Descriptor

func (*Artifact) Index

func (d *Artifact) Index() (*Index, error)

func (*Artifact) IsIndex

func (d *Artifact) IsIndex() bool

func (*Artifact) IsManifest

func (d *Artifact) IsManifest() bool

func (*Artifact) IsValid

func (d *Artifact) IsValid() bool

func (*Artifact) Manifest

func (d *Artifact) Manifest() (*Manifest, error)

func (Artifact) MarshalJSON

func (d Artifact) MarshalJSON() ([]byte, error)

func (*Artifact) MimeType

func (d *Artifact) MimeType() string

func (*Artifact) SetAnnotation added in v0.4.1

func (d *Artifact) SetAnnotation(name, value string) error

func (*Artifact) SetIndex

func (d *Artifact) SetIndex(i *Index) error

func (*Artifact) SetManifest

func (d *Artifact) SetManifest(m *Manifest) error

func (*Artifact) ToBlobAccess

func (d *Artifact) ToBlobAccess() (blobaccess.BlobAccess, error)

func (*Artifact) UnmarshalJSON

func (d *Artifact) UnmarshalJSON(data []byte) error

type ArtifactDescriptor added in v0.7.0

type ArtifactDescriptor interface {
	IsManifest() bool
	IsIndex() bool
	IsValid() bool

	Digest() digest.Digest
	Blob() (blobaccess.BlobAccess, error)
	Artifact() *Artifact
	Manifest() (*Manifest, error)
	Index() (*Index, error)
}

type BlobDescriptorSource

type BlobDescriptorSource interface {
	GetBlobDescriptor(digest.Digest) *Descriptor
	MimeType() string
	IsValid() bool
}

type Descriptor

type Descriptor = ociv1.Descriptor

func DefaultBlobDescriptor

func DefaultBlobDescriptor(blob blobaccess.BlobAccess) *Descriptor

type ImageConfig

type ImageConfig = ociv1.Image

func ParseImageConfig

func ParseImageConfig(blob blobaccess.BlobAccess) (*ImageConfig, error)

type Index

type Index ociv1.Index

func DecodeIndex

func DecodeIndex(data []byte) (*Index, error)

func NewIndex

func NewIndex() *Index

func (*Index) AddManifest

func (i *Index) AddManifest(d *Descriptor)

func (*Index) Artifact added in v0.7.0

func (i *Index) Artifact() *Artifact

func (*Index) Blob added in v0.7.0

func (i *Index) Blob() (blobaccess.BlobAccess, error)

func (*Index) DeleteAnnotation added in v0.4.1

func (i *Index) DeleteAnnotation(name string)

func (*Index) Digest added in v0.7.0

func (i *Index) Digest() digest.Digest

func (*Index) GetBlobDescriptor

func (i *Index) GetBlobDescriptor(digest digest.Digest) *Descriptor

func (*Index) Index added in v0.7.0

func (i *Index) Index() (*Index, error)

func (*Index) IsIndex added in v0.7.0

func (i *Index) IsIndex() bool

func (*Index) IsManifest added in v0.7.0

func (i *Index) IsManifest() bool

func (*Index) IsValid

func (i *Index) IsValid() bool

func (*Index) Manifest added in v0.7.0

func (i *Index) Manifest() (*Manifest, error)

func (*Index) MimeType

func (i *Index) MimeType() string

func (*Index) SetAnnotation added in v0.4.1

func (i *Index) SetAnnotation(name, value string)

type Manifest

type Manifest ociv1.Manifest

func DecodeManifest

func DecodeManifest(data []byte) (*Manifest, error)

func NewManifest

func NewManifest() *Manifest

func (*Manifest) Artifact added in v0.7.0

func (i *Manifest) Artifact() *Artifact

func (*Manifest) Blob added in v0.7.0

func (m *Manifest) Blob() (blobaccess.BlobAccess, error)

func (*Manifest) DeleteAnnotation added in v0.4.1

func (m *Manifest) DeleteAnnotation(name string)

func (*Manifest) Digest added in v0.7.0

func (i *Manifest) Digest() digest.Digest

func (*Manifest) GetBlobDescriptor

func (m *Manifest) GetBlobDescriptor(digest digest.Digest) *Descriptor

func (*Manifest) Index added in v0.7.0

func (i *Manifest) Index() (*Index, error)

func (*Manifest) IsIndex added in v0.7.0

func (i *Manifest) IsIndex() bool

func (*Manifest) IsManifest added in v0.7.0

func (i *Manifest) IsManifest() bool

func (*Manifest) IsValid

func (i *Manifest) IsValid() bool

func (*Manifest) Manifest added in v0.7.0

func (i *Manifest) Manifest() (*Manifest, error)

func (*Manifest) MimeType

func (m *Manifest) MimeType() string

func (*Manifest) SetAnnotation added in v0.4.1

func (m *Manifest) SetAnnotation(name, value string)

type Platform

type Platform = ociv1.Platform

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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