cpi

package
v0.1.0-alpha.1 Latest Latest
Warning

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

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

README

Context Provider Interface for Repository with OCI-Artefact-Data

Documentation

Index

Constants

View Source
const (
	KIND_OCIARTEFACT = internal.KIND_OCIARTEFACT
	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 artefacts")

Functions

func AdjustSize

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

func ErrBlobNotFound

func ErrBlobNotFound(digest digest.Digest) error

func ErrUnknownArtefact

func ErrUnknownArtefact(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 NewArtefactStateHandler

func NewArtefactStateHandler() accessobj.StateHandler

func NewIndex

func NewIndex(access ArtefactSetContainer, 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 Artefact

type Artefact = internal.Artefact

type ArtefactAccess

type ArtefactAccess = internal.ArtefactAccess

func NewArtefact

func NewArtefact(access ArtefactSetContainer, defs ...*artdesc.Artefact) (ArtefactAccess, error)

type ArtefactImpl

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

func NewArtefactForBlob

func NewArtefactForBlob(access ArtefactSetContainer, blob accessio.BlobAccess) (*ArtefactImpl, error)

func NewArtefactForProviderBlob

func NewArtefactForProviderBlob(access ArtefactSetContainer, p ArtefactProvider, blob accessio.BlobAccess) (*ArtefactImpl, error)

func (*ArtefactImpl) AddArtefact

func (a *ArtefactImpl) AddArtefact(art Artefact, platform *artdesc.Platform) (accessio.BlobAccess, error)

func (*ArtefactImpl) AddBlob

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

func (*ArtefactImpl) AddLayer

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

func (*ArtefactImpl) Artefact

func (a *ArtefactImpl) Artefact() *artdesc.Artefact

func (*ArtefactImpl) Blob

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

func (*ArtefactImpl) Close

func (a *ArtefactImpl) Close() error

func (*ArtefactImpl) Digest

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

func (*ArtefactImpl) GetArtefact

func (a *ArtefactImpl) GetArtefact(digest digest.Digest) (ArtefactAccess, error)

func (*ArtefactImpl) GetBlob

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

func (*ArtefactImpl) GetBlobData

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

func (*ArtefactImpl) GetBlobDescriptor

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

func (*ArtefactImpl) GetDescriptor

func (a *ArtefactImpl) GetDescriptor() *artdesc.Artefact

func (*ArtefactImpl) Index

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

func (*ArtefactImpl) IndexAccess

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

func (*ArtefactImpl) IsClosed

func (a *ArtefactImpl) IsClosed() bool

func (*ArtefactImpl) IsIndex

func (a *ArtefactImpl) IsIndex() bool

func (*ArtefactImpl) IsManifest

func (a *ArtefactImpl) IsManifest() bool

func (*ArtefactImpl) IsReadOnly

func (a *ArtefactImpl) IsReadOnly() bool

func (*ArtefactImpl) Manifest

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

func (*ArtefactImpl) ManifestAccess

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

func (*ArtefactImpl) NewArtefact

func (a *ArtefactImpl) NewArtefact(art ...*artdesc.Artefact) (ArtefactAccess, error)

type ArtefactProvider

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

	BlobSource
	BlobSink

	// GetArtefact is used to access nested artefacts (only)
	GetArtefact(digest digest.Digest) (ArtefactAccess, error)
	// AddArtefact is used to add nested artefacts (only)
	AddArtefact(art Artefact) (access accessio.BlobAccess, err error)
}

ArtefactProvider manages the technical access to a dedicated artefact.

func NewNopCloserArtefactProvider

func NewNopCloserArtefactProvider(p ArtefactSetContainer) ArtefactProvider

type ArtefactSetAccess

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

func NewArtefactSetAccess

func NewArtefactSetAccess(container ArtefactSetContainer) *ArtefactSetAccess

func (*ArtefactSetAccess) AddArtefact

func (a *ArtefactSetAccess) AddArtefact(artefact Artefact, tags ...string) (access accessio.BlobAccess, err error)

func (*ArtefactSetAccess) AddBlob

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

func (*ArtefactSetAccess) GetBlob

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

func (*ArtefactSetAccess) GetBlobData

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

func (*ArtefactSetAccess) GetBlobDescriptor

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

func (*ArtefactSetAccess) IsClosed

func (a *ArtefactSetAccess) IsClosed() bool

func (*ArtefactSetAccess) IsReadOnly

func (a *ArtefactSetAccess) IsReadOnly() bool

type ArtefactSetContainer

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

	Close() error

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

	GetArtefact(vers string) (ArtefactAccess, error)
	AddArtefact(artefact Artefact, tags ...string) (access accessio.BlobAccess, err error)

	NewArtefactProvider(state accessobj.State) (ArtefactProvider, error)
}

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

type ArtefactSink

type ArtefactSink = internal.ArtefactSink

type ArtefactSource

type ArtefactSource = internal.ArtefactSource

type ArtefactStateHandler

type ArtefactStateHandler struct{}

func (ArtefactStateHandler) Decode

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

func (ArtefactStateHandler) Encode

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

func (ArtefactStateHandler) Equivalent

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

func (ArtefactStateHandler) Initial

func (i ArtefactStateHandler) 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 NewIndexForArtefact

func NewIndexForArtefact(a *ArtefactImpl) *IndexImpl

func (*IndexImpl) AddArtefact

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

func (*IndexImpl) AddBlob

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

func (*IndexImpl) Artefact

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

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) GetArtefact

func (i *IndexImpl) GetArtefact(digest digest.Digest) (internal.ArtefactAccess, 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) NewArtefact

func (a *IndexImpl) NewArtefact(art ...*artdesc.Artefact) (ArtefactAccess, 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 ArtefactSetContainer, defs ...*artdesc.Manifest) (*ManifestImpl, error)

func NewManifestForArtefact

func NewManifestForArtefact(a *ArtefactImpl) *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) Artefact

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

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 NopCloserArtefactProvider

type NopCloserArtefactProvider struct {
	ArtefactSetContainer
}

func (*NopCloserArtefactProvider) AddArtefact

func (p *NopCloserArtefactProvider) AddArtefact(art Artefact) (access accessio.BlobAccess, err error)

func (*NopCloserArtefactProvider) Close

func (p *NopCloserArtefactProvider) Close() error

func (*NopCloserArtefactProvider) GetArtefact

func (p *NopCloserArtefactProvider) GetArtefact(digest digest.Digest) (ArtefactAccess, 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