cpi

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

README

Context Provider Interface for Repository with OCI-Artifact-Data

Documentation

Index

Constants

View Source
const (
	KIND_OCIARTIFACT = internal.KIND_OCIARTIFACT
	KIND_MEDIATYPE   = accessio.KIND_MEDIATYPE
	KIND_BLOB        = accessio.KIND_BLOB
)
View Source
const CONTEXT_TYPE = internal.CONTEXT_TYPE
View Source
const CommonTransportFormat = internal.CommonTransportFormat

Variables

View Source
var DefaultContext = internal.DefaultContext
View Source
var ErrNoIndex = errors.New("manifest does not support access to subsequent artifacts")

Functions

func AdjustSize

func AdjustSize(d *artdesc.Descriptor, size int64) error

func ErrBlobNotFound

func ErrBlobNotFound(digest digest.Digest) error

func ErrUnknownArtifact

func ErrUnknownArtifact(name, version string) error

func FilterByNamespacePrefix

func FilterByNamespacePrefix(prefix string, list []string) []string

func FilterChildren

func FilterChildren(closure bool, list []string) []string

func IsErrBlobNotFound

func IsErrBlobNotFound(err error) bool

func NewArtifactStateHandler

func NewArtifactStateHandler() accessobj.StateHandler

func NewIndex

func NewIndex(access ArtifactSetContainer, defs ...*artdesc.Index) (internal.IndexAccess, error)

func NewIndexStateHandler

func NewIndexStateHandler() accessobj.StateHandler

func NewManifestStateHandler

func NewManifestStateHandler() accessobj.StateHandler

func RegisterRepositorySpecHandler

func RegisterRepositorySpecHandler(handler RepositorySpecHandler, types ...string)

func RegisterRepositoryType

func RegisterRepositoryType(name string, atype RepositoryType)

Types

type Artifact

type Artifact = internal.Artifact

type ArtifactAccess

type ArtifactAccess = internal.ArtifactAccess

func NewArtifact

func NewArtifact(access ArtifactSetContainer, defs ...*artdesc.Artifact) (ArtifactAccess, error)

type ArtifactImpl

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

func NewArtifactForBlob

func NewArtifactForBlob(access ArtifactSetContainer, blob accessio.BlobAccess) (*ArtifactImpl, error)

func NewArtifactForProviderBlob

func NewArtifactForProviderBlob(access ArtifactSetContainer, p ArtifactProvider, blob accessio.BlobAccess) (*ArtifactImpl, error)

func (*ArtifactImpl) AddArtifact

func (a *ArtifactImpl) AddArtifact(art Artifact, platform *artdesc.Platform) (accessio.BlobAccess, error)

func (*ArtifactImpl) AddBlob

func (a *ArtifactImpl) AddBlob(access BlobAccess) error

func (*ArtifactImpl) AddLayer

func (a *ArtifactImpl) AddLayer(blob BlobAccess, d *Descriptor) (int, error)

func (*ArtifactImpl) Artifact

func (a *ArtifactImpl) Artifact() *artdesc.Artifact

func (*ArtifactImpl) Blob

func (a *ArtifactImpl) Blob() (accessio.BlobAccess, error)

func (*ArtifactImpl) Close

func (a *ArtifactImpl) Close() error

func (*ArtifactImpl) Digest

func (a *ArtifactImpl) Digest() digest.Digest

func (*ArtifactImpl) GetArtifact

func (a *ArtifactImpl) GetArtifact(digest digest.Digest) (ArtifactAccess, error)

func (*ArtifactImpl) GetBlob

func (a *ArtifactImpl) GetBlob(digest digest.Digest) (BlobAccess, error)

func (*ArtifactImpl) GetBlobData

func (a *ArtifactImpl) GetBlobData(digest digest.Digest) (int64, DataAccess, error)

func (*ArtifactImpl) GetBlobDescriptor

func (a *ArtifactImpl) GetBlobDescriptor(digest digest.Digest) *Descriptor

func (*ArtifactImpl) GetDescriptor

func (a *ArtifactImpl) GetDescriptor() *artdesc.Artifact

func (*ArtifactImpl) Index

func (a *ArtifactImpl) Index() (*artdesc.Index, error)

func (*ArtifactImpl) IndexAccess

func (a *ArtifactImpl) IndexAccess() internal.IndexAccess

func (*ArtifactImpl) IsClosed

func (a *ArtifactImpl) IsClosed() bool

func (*ArtifactImpl) IsIndex

func (a *ArtifactImpl) IsIndex() bool

func (*ArtifactImpl) IsManifest

func (a *ArtifactImpl) IsManifest() bool

func (*ArtifactImpl) IsReadOnly

func (a *ArtifactImpl) IsReadOnly() bool

func (*ArtifactImpl) Manifest

func (a *ArtifactImpl) Manifest() (*artdesc.Manifest, error)

func (*ArtifactImpl) ManifestAccess

func (a *ArtifactImpl) ManifestAccess() internal.ManifestAccess

func (*ArtifactImpl) NewArtifact

func (a *ArtifactImpl) NewArtifact(art ...*artdesc.Artifact) (ArtifactAccess, error)

type ArtifactProvider

type ArtifactProvider interface {
	IsClosed() bool
	IsReadOnly() bool
	GetBlobDescriptor(digest digest.Digest) *Descriptor
	Close() error

	BlobSource
	BlobSink

	// GetArtifact is used to access nested artifacts (only)
	GetArtifact(digest digest.Digest) (ArtifactAccess, error)
	// AddArtifact is used to add nested artifacts (only)
	AddArtifact(art Artifact) (access accessio.BlobAccess, err error)
}

ArtifactProvider manages the technical access to a dedicated artifact.

func NewNopCloserArtifactProvider

func NewNopCloserArtifactProvider(p ArtifactSetContainer) ArtifactProvider

type ArtifactSetAccess

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

func NewArtifactSetAccess

func NewArtifactSetAccess(container ArtifactSetContainer) *ArtifactSetAccess

func (*ArtifactSetAccess) AddArtifact

func (a *ArtifactSetAccess) AddArtifact(artifact Artifact, tags ...string) (access accessio.BlobAccess, err error)

func (*ArtifactSetAccess) AddBlob

func (a *ArtifactSetAccess) AddBlob(blob BlobAccess) error

func (*ArtifactSetAccess) GetBlob

func (a *ArtifactSetAccess) GetBlob(digest digest.Digest) (BlobAccess, error)

func (*ArtifactSetAccess) GetBlobData

func (a *ArtifactSetAccess) GetBlobData(digest digest.Digest) (int64, DataAccess, error)

func (*ArtifactSetAccess) GetBlobDescriptor

func (a *ArtifactSetAccess) GetBlobDescriptor(digest digest.Digest) *Descriptor

func (*ArtifactSetAccess) IsClosed

func (a *ArtifactSetAccess) IsClosed() bool

func (*ArtifactSetAccess) IsReadOnly

func (a *ArtifactSetAccess) IsReadOnly() bool

type ArtifactSetContainer

type ArtifactSetContainer interface {
	IsReadOnly() bool
	IsClosed() bool

	Close() error

	GetBlobDescriptor(digest digest.Digest) *Descriptor
	GetBlobData(digest digest.Digest) (int64, DataAccess, error)
	AddBlob(blob BlobAccess) error

	GetArtifact(vers string) (ArtifactAccess, error)
	AddArtifact(artifact Artifact, tags ...string) (access accessio.BlobAccess, err error)

	NewArtifactProvider(state accessobj.State) (ArtifactProvider, error)
}

ArtifactSetContainer is the interface used by subsequent access objects to access the base implementation.

type ArtifactSink

type ArtifactSink = internal.ArtifactSink

type ArtifactSource

type ArtifactSource = internal.ArtifactSource

type ArtifactStateHandler

type ArtifactStateHandler struct{}

func (ArtifactStateHandler) Decode

func (i ArtifactStateHandler) Decode(data []byte) (interface{}, error)

func (ArtifactStateHandler) Encode

func (i ArtifactStateHandler) Encode(d interface{}) ([]byte, error)

func (ArtifactStateHandler) Equivalent

func (i ArtifactStateHandler) Equivalent(a, b interface{}) bool

func (ArtifactStateHandler) Initial

func (i ArtifactStateHandler) Initial() interface{}

type BlobAccess

type BlobAccess = internal.BlobAccess

type BlobSink

type BlobSink = internal.BlobSink

type BlobSource

type BlobSource = internal.BlobSource

type Context

type Context = internal.Context

func New

type ContextProvider

type ContextProvider = internal.ContextProvider

type DataAccess

type DataAccess = internal.DataAccess

type DefaultRepositoryType

type DefaultRepositoryType struct {
	runtime.ObjectVersionedType
	runtime.TypedObjectDecoder
}

type Descriptor

type Descriptor = ociv1.Descriptor

type GenericRepositorySpec

type GenericRepositorySpec = internal.GenericRepositorySpec

func ToGenericRepositorySpec

func ToGenericRepositorySpec(spec RepositorySpec) (*GenericRepositorySpec, error)

type IndexAccess

type IndexAccess = internal.IndexAccess

type IndexImpl

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

func NewIndexForArtifact

func NewIndexForArtifact(a *ArtifactImpl) *IndexImpl

func (*IndexImpl) AddArtifact

func (a *IndexImpl) AddArtifact(art Artifact, platform *artdesc.Platform) (access accessio.BlobAccess, err error)

func (*IndexImpl) AddBlob

func (i *IndexImpl) AddBlob(blob internal.BlobAccess) error

func (*IndexImpl) Artifact

func (i *IndexImpl) Artifact() *artdesc.Artifact

func (*IndexImpl) Blob

func (a *IndexImpl) Blob() (accessio.BlobAccess, error)

func (*IndexImpl) Close

func (a *IndexImpl) Close() error

func (*IndexImpl) Digest

func (a *IndexImpl) Digest() digest.Digest

func (*IndexImpl) GetArtifact

func (i *IndexImpl) GetArtifact(digest digest.Digest) (internal.ArtifactAccess, error)

func (*IndexImpl) GetBlob

func (i *IndexImpl) GetBlob(digest digest.Digest) (internal.BlobAccess, error)

func (*IndexImpl) GetBlobDescriptor

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

func (*IndexImpl) GetDescriptor

func (i *IndexImpl) GetDescriptor() *artdesc.Index

func (*IndexImpl) GetIndex

func (i *IndexImpl) GetIndex(digest digest.Digest) (internal.IndexAccess, error)

func (*IndexImpl) GetManifest

func (i *IndexImpl) GetManifest(digest digest.Digest) (internal.ManifestAccess, error)

func (*IndexImpl) Index

func (i *IndexImpl) Index() (*artdesc.Index, error)

func (*IndexImpl) IsClosed

func (a *IndexImpl) IsClosed() bool

func (*IndexImpl) IsIndex

func (a *IndexImpl) IsIndex() bool

func (*IndexImpl) IsManifest

func (a *IndexImpl) IsManifest() bool

func (*IndexImpl) IsReadOnly

func (a *IndexImpl) IsReadOnly() bool

func (*IndexImpl) Manifest

func (i *IndexImpl) Manifest() (*artdesc.Manifest, error)

func (*IndexImpl) NewArtifact

func (a *IndexImpl) NewArtifact(art ...*artdesc.Artifact) (ArtifactAccess, error)

type IndexStateHandler

type IndexStateHandler struct{}

func (IndexStateHandler) Decode

func (i IndexStateHandler) Decode(data []byte) (interface{}, error)

func (IndexStateHandler) Encode

func (i IndexStateHandler) Encode(d interface{}) ([]byte, error)

func (IndexStateHandler) Equivalent

func (i IndexStateHandler) Equivalent(a, b interface{}) bool

func (IndexStateHandler) Initial

func (i IndexStateHandler) Initial() interface{}

type IntermediateRepositorySpecAspect

type IntermediateRepositorySpecAspect = internal.IntermediateRepositorySpecAspect

type ManifestAccess

type ManifestAccess = internal.ManifestAccess

type ManifestImpl

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

func NewManifest

func NewManifest(access ArtifactSetContainer, defs ...*artdesc.Manifest) (*ManifestImpl, error)

func NewManifestForArtifact

func NewManifestForArtifact(a *ArtifactImpl) *ManifestImpl

func (*ManifestImpl) AddBlob

func (m *ManifestImpl) AddBlob(access BlobAccess) error

func (*ManifestImpl) AddLayer

func (m *ManifestImpl) AddLayer(blob BlobAccess, d *artdesc.Descriptor) (int, error)

func (*ManifestImpl) Artifact

func (m *ManifestImpl) Artifact() *artdesc.Artifact

func (*ManifestImpl) Blob

func (a *ManifestImpl) Blob() (accessio.BlobAccess, error)

func (*ManifestImpl) Close

func (a *ManifestImpl) Close() error

func (*ManifestImpl) Digest

func (a *ManifestImpl) Digest() digest.Digest

func (*ManifestImpl) GetBlob

func (m *ManifestImpl) GetBlob(digest digest.Digest) (BlobAccess, error)

func (*ManifestImpl) GetBlobDescriptor

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

func (*ManifestImpl) GetConfigBlob

func (m *ManifestImpl) GetConfigBlob() (BlobAccess, error)

func (*ManifestImpl) GetDescriptor

func (m *ManifestImpl) GetDescriptor() *artdesc.Manifest

func (*ManifestImpl) Index

func (m *ManifestImpl) Index() (*artdesc.Index, error)

func (*ManifestImpl) IsClosed

func (a *ManifestImpl) IsClosed() bool

func (*ManifestImpl) IsIndex

func (a *ManifestImpl) IsIndex() bool

func (*ManifestImpl) IsManifest

func (a *ManifestImpl) IsManifest() bool

func (*ManifestImpl) IsReadOnly

func (a *ManifestImpl) IsReadOnly() bool

func (*ManifestImpl) Manifest

func (m *ManifestImpl) Manifest() (*artdesc.Manifest, error)

func (*ManifestImpl) SetConfigBlob

func (m *ManifestImpl) SetConfigBlob(blob BlobAccess, d *artdesc.Descriptor) error

type ManifestStateHandler

type ManifestStateHandler struct{}

func (ManifestStateHandler) Decode

func (i ManifestStateHandler) Decode(data []byte) (interface{}, error)

func (ManifestStateHandler) Encode

func (i ManifestStateHandler) Encode(d interface{}) ([]byte, error)

func (ManifestStateHandler) Equivalent

func (i ManifestStateHandler) Equivalent(a, b interface{}) bool

func (ManifestStateHandler) Initial

func (i ManifestStateHandler) Initial() interface{}

type NamespaceAccess

type NamespaceAccess = internal.NamespaceAccess

type NamespaceLister

type NamespaceLister = internal.NamespaceLister

type NopCloserArtifactProvider

type NopCloserArtifactProvider struct {
	ArtifactSetContainer
}

func (*NopCloserArtifactProvider) AddArtifact

func (p *NopCloserArtifactProvider) AddArtifact(art Artifact) (access accessio.BlobAccess, err error)

func (*NopCloserArtifactProvider) Close

func (p *NopCloserArtifactProvider) Close() error

func (*NopCloserArtifactProvider) GetArtifact

func (p *NopCloserArtifactProvider) GetArtifact(digest digest.Digest) (ArtifactAccess, error)

type Repository

type Repository = internal.Repository

type RepositorySource

type RepositorySource = internal.RepositorySource

type RepositorySpec

type RepositorySpec = internal.RepositorySpec

type RepositorySpecHandler

type RepositorySpecHandler = internal.RepositorySpecHandler

type RepositorySpecHandlers

type RepositorySpecHandlers = internal.RepositorySpecHandlers

type RepositoryType

type RepositoryType = internal.RepositoryType

func NewRepositoryType

func NewRepositoryType(name string, proto RepositorySpec) RepositoryType

type StringList

type StringList []string

func (*StringList) Add

func (s *StringList) Add(n string)

type UniformRepositorySpec

type UniformRepositorySpec = internal.UniformRepositorySpec

func UniformRepositorySpecForHostURL

func UniformRepositorySpecForHostURL(typ string, host string) *UniformRepositorySpec

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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