cpi

package
v0.0.0-...-877fc11 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

README

Context Provider Interface for Component Repositories

Documentation

Index

Constants

View Source
const (
	KIND_COMPONENTVERSION = internal.KIND_COMPONENTVERSION
	KIND_RESOURCE         = internal.KIND_RESOURCE
	KIND_SOURCE           = internal.KIND_SOURCE
	KIND_REFERENCE        = internal.KIND_REFERENCE
)
View Source
const CONTEXT_TYPE = internal.CONTEXT_TYPE
View Source
const CommonTransportFormat = internal.CommonTransportFormat

Variables

View Source
var TAG_BLOBHANDLER = logging.DefineTag("blobhandler", "execution of blob handler used to upload resource blobs to an ocm repository.")

Functions

func AcceptExistentDigests

func AcceptExistentDigests(flag ...bool) internal.ModOptionImpl

func ArtifactNameHint

func ArtifactNameHint(spec AccessSpec, cv ComponentVersionAccess) string

func BlobHandlerLogger

func BlobHandlerLogger(ctx Context, messageContext ...logging.MessageContext) logging.Logger

func CompleteModificationOptions

func CompleteModificationOptions(ctx ContextProvider, m *ModificationOptions)

func DefaultContext

func DefaultContext() internal.Context

func ErrComponentVersionNotFound

func ErrComponentVersionNotFound(name, version string) error

func ErrComponentVersionNotFoundWrap

func ErrComponentVersionNotFoundWrap(err error, name, version string) error

func GetRefParseHandler

func GetRefParseHandler(ty string, h ParseHandler)

func GetResourceMimeReader

func GetResourceMimeReader(acc AccessProvider) (io.ReadCloser, string, error)

GetResourceMimeReader gets a Reader for a given resource/source access. It provides a Reader handling the Close contract for the access method. Additionally, the mime type is returned.

func GetResourceReader

func GetResourceReader(acc AccessProvider) (io.ReadCloser, error)

GetResourceMimeReader gets a Reader for a given resource/source access. It provides a Reader handling the Close contract for the access method.

func Logger

func Logger(c OCMContextProvider, keyValuePairs ...interface{}) logging.Logger

func ModifyResource

func ModifyResource(flag ...bool) internal.ModOptionImpl

func MustRegisterDigester

func MustRegisterDigester(digester BlobDigester, arttypes ...string)

func NewArtifactAccessForProvider

func NewArtifactAccessForProvider[M any](meta *M, prov AccessProvider) cpi.ArtifactAccess[M]

func NewArtifactAccessProviderForBlobAccessProvider

func NewArtifactAccessProviderForBlobAccessProvider[M any](ctx Context, meta *M, src blobAccessProvider, hint string, global AccessSpec) cpi.ArtifactAccess[M]

func ReferenceHint

func ReferenceHint(spec AccessSpec, cv ComponentVersionAccess) string

func RegisterBlobHandler

func RegisterBlobHandler(handler BlobHandler, opts ...BlobHandlerOption)

func RegisterBlobHandlerRegistrationHandler

func RegisterBlobHandlerRegistrationHandler(path string, handler BlobHandlerRegistrationHandler)

func RegisterRefParseHandler

func RegisterRefParseHandler(ty string, h ParseHandler)

func RegisterRepositorySpecHandler

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

func RegisterRepositoryType

func RegisterRepositoryType(rtype RepositoryType)

func RegisterRepositoryTypeVersions

func RegisterRepositoryTypeVersions(s RepositoryTypeVersionScheme)

func RepositoryPrefix

func RepositoryPrefix(spec RepositorySpec) string

func ResourceMimeReader

func ResourceMimeReader(s AccessMethodSource) (io.ReadCloser, string, error)

ResourceMimeReader gets a Reader for a given resource/source access. It provides a Reader handling the Close contract for the access method by connecting the access method's Close method to the Readers Close method. Additionally, the mime type is returned. Deprecated: use GetResourceMimeReader. It must be deprecated because of the support of free-floating ReSourceAccess implementations, they not necessarily provide an AccessMethod.

func ResourceReader

func ResourceReader(s AccessMethodSource) (io.ReadCloser, error)

ResourceReader gets a Reader for a given resource/source access. It provides a Reader handling the Close contract for the access method by connecting the access method's Close method to the Readers Close method . Deprecated: use GetResourceReader. It must be deprecated because of the support of free-floating ReSourceAccess implementations, they not necessarily provide an AccessMethod.

func SetDefaultDigester

func SetDefaultDigester(d BlobDigester)

func SkipDigest deprecated

func SkipDigest(flag ...bool) internal.ModOptionImpl

SkipDigest disables digest creation if enabled.

Deprecated: for legacy code, only.

func SkipVerify

func SkipVerify(flag ...bool) internal.ModOptionImpl

func WithAccessypeScheme

func WithAccessypeScheme(scheme AccessTypeScheme) internal.Builder

func WithBlobDigesters

func WithBlobDigesters(reg BlobDigesterRegistry) internal.Builder

func WithBlobHandlers

func WithBlobHandlers(reg BlobHandlerRegistry) internal.Builder

func WithContext

func WithContext(ctx context.Context) internal.Builder

func WithCredentials

func WithCredentials(ctx credentials.Context) internal.Builder

func WithDefaultHashAlgorithm

func WithDefaultHashAlgorithm(algo ...string) internal.ModOptionImpl

func WithHasherProvider

func WithHasherProvider(prov HasherProvider) internal.ModOptionImpl

func WithOCIRepositories

func WithOCIRepositories(ctx oci.Context) internal.Builder

func WithRepositoryDelegation

func WithRepositoryDelegation(reg RepositoryDelegationRegistry) internal.Builder

func WithRepositorySpecHandlers

func WithRepositorySpecHandlers(reg RepositorySpecHandlers) internal.Builder

func WithRepositoyTypeScheme

func WithRepositoyTypeScheme(scheme RepositoryTypeScheme) internal.Builder

Types

type AccessMethod

type AccessMethod = internal.AccessMethod

type AccessMethodSource

type AccessMethodSource interface {
	AccessMethod() (AccessMethod, error)
}

type AccessProvider

type AccessProvider = internal.AccessProvider

func NewAccessProviderForBlobAccessProvider

func NewAccessProviderForBlobAccessProvider(ctx ocm.Context, prov blobaccess.BlobAccessProvider, hint string, global AccessSpec) AccessProvider

func NewAccessProviderForExternalAccessSpec

func NewAccessProviderForExternalAccessSpec(ctx ocm.Context, spec AccessSpec) (AccessProvider, error)

type AccessSpec

type AccessSpec = internal.AccessSpec

func GlobalAccess

func GlobalAccess(spec AccessSpec, ctx Context) AccessSpec

type AccessSpecDecoder

type AccessSpecDecoder = internal.AccessSpecDecoder

type AccessSpecRef

type AccessSpecRef = internal.AccessSpecRef

func NewAccessSpecRef

func NewAccessSpecRef(spec AccessSpec) *AccessSpecRef

func NewRawAccessSpecRef

func NewRawAccessSpecRef(data []byte, unmarshaler runtime.Unmarshaler) (*AccessSpecRef, error)

type AccessTypeProvider

type AccessTypeProvider = internal.AccessTypeProvider

type AccessTypeScheme

type AccessTypeScheme = internal.AccessTypeScheme

type AddVersionOption

type AddVersionOption = internal.AddVersionOption

func Overwrite

func Overwrite(flag ...bool) AddVersionOption

Overwrite enabled the overwrite mode for adding a component version.

type AddVersionOptions

type AddVersionOptions = internal.AddVersionOptions

func NewAddVersionOptions

func NewAddVersionOptions(list ...AddVersionOption) *AddVersionOptions

type ArtifactAccess

type ArtifactAccess[M any] internal.ArtifactAccess[M]

type BaseAccess deprecated

Deprecated: use ComponentVersionBasedAccessProvider.

type BlobAccess

type BlobAccess = internal.BlobAccess

type BlobDigester

type BlobDigester = internal.BlobDigester

type BlobDigesterRegistry

type BlobDigesterRegistry = internal.BlobDigesterRegistry

func DefaultBlobDigesterRegistry

func DefaultBlobDigesterRegistry() BlobDigesterRegistry

type BlobHandler

type BlobHandler = internal.BlobHandler

type BlobHandlerConfig

type BlobHandlerConfig = internal.BlobHandlerConfig

type BlobHandlerKey

type BlobHandlerKey = internal.BlobHandlerKey

type BlobHandlerOption

type BlobHandlerOption = internal.BlobHandlerOption

func ForArtifactType

func ForArtifactType(arttype string) BlobHandlerOption

func ForMimeType

func ForMimeType(mimetype string) BlobHandlerOption

func ForRepo

func ForRepo(ctxtype, repostype string) BlobHandlerOption

func WithPrio

func WithPrio(p int) BlobHandlerOption

type BlobHandlerOptions

type BlobHandlerOptions = internal.BlobHandlerOptions

func NewBlobHandlerOptions

func NewBlobHandlerOptions(olist ...BlobHandlerOption) *BlobHandlerOptions

type BlobHandlerProvider

type BlobHandlerProvider = internal.BlobHandlerProvider

func DefaultBlobHandlerProvider

func DefaultBlobHandlerProvider(ctx Context) BlobHandlerProvider

type BlobHandlerRegistrationHandler

type BlobHandlerRegistrationHandler = internal.BlobHandlerRegistrationHandler

type BlobHandlerRegistry

type BlobHandlerRegistry = internal.BlobHandlerRegistry

type BlobModificationOption

type BlobModificationOption = internal.BlobModificationOption

type BlobModificationOptions

type BlobModificationOptions = internal.BlobModificationOptions

func NewBlobModificationOptions

func NewBlobModificationOptions(list ...BlobModificationOption) *BlobModificationOptions

type BlobUploadOption

type BlobUploadOption = internal.BlobUploadOption

type BlobUploadOptions

type BlobUploadOptions = internal.BlobUploadOptions

func NewBlobUploadOptions

func NewBlobUploadOptions(list ...BlobUploadOption) *BlobUploadOptions

type ComponentAccess

type ComponentAccess = internal.ComponentAccess

type ComponentLister

type ComponentLister = internal.ComponentLister

type ComponentReference

type ComponentReference = internal.ComponentReference

type ComponentVersionAccess

type ComponentVersionAccess = internal.ComponentVersionAccess

type ComponentVersionBasedAccessProvider

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

func (*ComponentVersionBasedAccessProvider) Access

func (*ComponentVersionBasedAccessProvider) AccessMethod

func (*ComponentVersionBasedAccessProvider) BlobAccess

func (*ComponentVersionBasedAccessProvider) GetComponentVersion

func (*ComponentVersionBasedAccessProvider) GetOCMContext

func (r *ComponentVersionBasedAccessProvider) GetOCMContext() Context

func (*ComponentVersionBasedAccessProvider) GlobalAccess

func (*ComponentVersionBasedAccessProvider) ReferenceHint

func (r *ComponentVersionBasedAccessProvider) ReferenceHint() string

type ComponentVersionProvider

type ComponentVersionProvider interface {
	GetComponentVersion() (ComponentVersionAccess, error)
}

ComponentVersionProvider should be implemented by Accesses based on component version instances. It is used to determine access type specific information. For example, OCI based access types may provide global OCI artifact references.

type ComponentVersionResolver

type ComponentVersionResolver = internal.ComponentVersionResolver

type Context

type Context = internal.Context

func FromProvider

func FromProvider(p ContextProvider) Context

func New

func New(mode ...datacontext.BuilderMode) Context

type ContextProvider

type ContextProvider = internal.ContextProvider

func WrapContextProvider

func WrapContextProvider(ctx LocalContextProvider) ContextProvider

type DataAccess

type DataAccess = internal.DataAccess

type DefaultStorageContext

type DefaultStorageContext struct {
	ComponentRepository          Repository
	ComponentName                string
	ImplementationRepositoryType ImplementationRepositoryType
}

func NewDefaultStorageContext

func NewDefaultStorageContext(repo Repository, compname string, reptype ImplementationRepositoryType) *DefaultStorageContext

func (*DefaultStorageContext) GetContext

func (c *DefaultStorageContext) GetContext() Context

func (*DefaultStorageContext) GetImplementationRepositoryType

func (c *DefaultStorageContext) GetImplementationRepositoryType() ImplementationRepositoryType

func (*DefaultStorageContext) TargetComponentName

func (c *DefaultStorageContext) TargetComponentName() string

func (*DefaultStorageContext) TargetComponentRepository

func (c *DefaultStorageContext) TargetComponentRepository() Repository

type DigestDescriptor

type DigestDescriptor = internal.DigestDescriptor

func NewDigestDescriptor

func NewDigestDescriptor(digest string, typ DigesterType) *DigestDescriptor

type DigesterType

type DigesterType = internal.DigesterType

type DummyComponentVersionAccess

type DummyComponentVersionAccess struct {
	Context Context
}

func (*DummyComponentVersionAccess) AccessMethod

func (d *DummyComponentVersionAccess) AccessMethod(spec AccessSpec) (AccessMethod, error)

func (*DummyComponentVersionAccess) AddBlob

func (d *DummyComponentVersionAccess) AddBlob(blob BlobAccess, arttype, refName string, global AccessSpec, opts ...BlobUploadOption) (AccessSpec, error)

func (*DummyComponentVersionAccess) AdjustResourceAccess

func (d *DummyComponentVersionAccess) AdjustResourceAccess(meta *internal.ResourceMeta, acc compdesc.AccessSpec, opts ...ModificationOption) error

func (*DummyComponentVersionAccess) AdjustSourceAccess

func (d *DummyComponentVersionAccess) AdjustSourceAccess(meta *internal.SourceMeta, acc compdesc.AccessSpec) error

func (*DummyComponentVersionAccess) Close

func (*DummyComponentVersionAccess) DiscardChanges

func (d *DummyComponentVersionAccess) DiscardChanges()

func (*DummyComponentVersionAccess) Dup

func (*DummyComponentVersionAccess) GetContext

func (d *DummyComponentVersionAccess) GetContext() Context

func (*DummyComponentVersionAccess) GetDescriptor

func (*DummyComponentVersionAccess) GetInexpensiveContentVersionIdentity

func (d *DummyComponentVersionAccess) GetInexpensiveContentVersionIdentity(spec AccessSpec) string

func (*DummyComponentVersionAccess) GetName

func (d *DummyComponentVersionAccess) GetName() string

func (*DummyComponentVersionAccess) GetProvider

func (d *DummyComponentVersionAccess) GetProvider() *compdesc.Provider

func (*DummyComponentVersionAccess) GetReference

func (*DummyComponentVersionAccess) GetReferenceByIndex

func (d *DummyComponentVersionAccess) GetReferenceByIndex(i int) (ComponentReference, error)

func (*DummyComponentVersionAccess) GetReferenceIndex

func (d *DummyComponentVersionAccess) GetReferenceIndex(metav1.Identity) int

func (*DummyComponentVersionAccess) GetReferencesByIdentitySelectors

func (d *DummyComponentVersionAccess) GetReferencesByIdentitySelectors(selectors ...compdesc.IdentitySelector) (compdesc.References, error)

func (*DummyComponentVersionAccess) GetReferencesByName

func (d *DummyComponentVersionAccess) GetReferencesByName(name string, selectors ...compdesc.IdentitySelector) (compdesc.References, error)

func (*DummyComponentVersionAccess) GetReferencesByReferenceSelectors

func (d *DummyComponentVersionAccess) GetReferencesByReferenceSelectors(selectors ...compdesc.ReferenceSelector) (compdesc.References, error)

func (*DummyComponentVersionAccess) GetResource

func (*DummyComponentVersionAccess) GetResourceByIndex

func (d *DummyComponentVersionAccess) GetResourceByIndex(i int) (ResourceAccess, error)

func (*DummyComponentVersionAccess) GetResourceIndex

func (d *DummyComponentVersionAccess) GetResourceIndex(metav1.Identity) int

func (*DummyComponentVersionAccess) GetResources

func (d *DummyComponentVersionAccess) GetResources() []ResourceAccess

func (*DummyComponentVersionAccess) GetResourcesByIdentitySelectors

func (d *DummyComponentVersionAccess) GetResourcesByIdentitySelectors(selectors ...compdesc.IdentitySelector) ([]internal.ResourceAccess, error)

func (*DummyComponentVersionAccess) GetResourcesByName

func (d *DummyComponentVersionAccess) GetResourcesByName(name string, selectors ...compdesc.IdentitySelector) ([]ResourceAccess, error)

func (*DummyComponentVersionAccess) GetResourcesByResourceSelectors

func (d *DummyComponentVersionAccess) GetResourcesByResourceSelectors(selectors ...compdesc.ResourceSelector) ([]internal.ResourceAccess, error)

func (*DummyComponentVersionAccess) GetSource

func (*DummyComponentVersionAccess) GetSourceByIndex

func (d *DummyComponentVersionAccess) GetSourceByIndex(i int) (SourceAccess, error)

func (*DummyComponentVersionAccess) GetSourceIndex

func (d *DummyComponentVersionAccess) GetSourceIndex(metav1.Identity) int

func (*DummyComponentVersionAccess) GetSources

func (d *DummyComponentVersionAccess) GetSources() []SourceAccess

func (*DummyComponentVersionAccess) GetVersion

func (d *DummyComponentVersionAccess) GetVersion() string

func (*DummyComponentVersionAccess) IsClosed

func (d *DummyComponentVersionAccess) IsClosed() bool

func (*DummyComponentVersionAccess) IsPersistent

func (d *DummyComponentVersionAccess) IsPersistent() bool

func (*DummyComponentVersionAccess) IsReadOnly

func (d *DummyComponentVersionAccess) IsReadOnly() bool

func (*DummyComponentVersionAccess) Repository

func (c *DummyComponentVersionAccess) Repository() Repository

func (*DummyComponentVersionAccess) SetProvider

func (*DummyComponentVersionAccess) SetReadOnly

func (d *DummyComponentVersionAccess) SetReadOnly()

func (*DummyComponentVersionAccess) SetReference

func (*DummyComponentVersionAccess) SetResource

func (*DummyComponentVersionAccess) SetResourceAccess

func (d *DummyComponentVersionAccess) SetResourceAccess(art ResourceAccess, modopts ...BlobModificationOption) error

func (*DummyComponentVersionAccess) SetResourceBlob

func (d *DummyComponentVersionAccess) SetResourceBlob(meta *ResourceMeta, blob BlobAccess, refname string, global AccessSpec, opts ...BlobModificationOption) error

func (*DummyComponentVersionAccess) SetSource

func (*DummyComponentVersionAccess) SetSourceBlob

func (d *DummyComponentVersionAccess) SetSourceBlob(meta *SourceMeta, blob BlobAccess, refname string, global AccessSpec) error

func (*DummyComponentVersionAccess) SetSourceByAccess

func (d *DummyComponentVersionAccess) SetSourceByAccess(art SourceAccess) error

func (*DummyComponentVersionAccess) Update

func (d *DummyComponentVersionAccess) Update() error

func (*DummyComponentVersionAccess) UseDirectAccess

func (d *DummyComponentVersionAccess) UseDirectAccess() bool

type GenericAccessSpec

type GenericAccessSpec = internal.GenericAccessSpec

func ToGenericAccessSpec

func ToGenericAccessSpec(spec AccessSpec) (*GenericAccessSpec, error)

type GenericRepositorySpec

type GenericRepositorySpec = internal.GenericRepositorySpec

func ToGenericRepositorySpec

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

type GlobalAccessProvider

type GlobalAccessProvider internal.GlobalAccessProvider

GlobalAccessProvider is able to provide a non-local access specification.

type Hasher

type Hasher = internal.Hasher

type HasherProvider

type HasherProvider = internal.HasherProvider

type HintProvider

type HintProvider internal.HintProvider

HintProvider is able to provide a name hint for globalization of local artifacts.

type ImplementationRepositoryType

type ImplementationRepositoryType = internal.ImplementationRepositoryType

type IntermediateRepositorySpecAspect

type IntermediateRepositorySpecAspect = internal.IntermediateRepositorySpecAspect

type LocalContextProvider

type LocalContextProvider = internal.LocalContextProvider

type ModificationOption

type ModificationOption = internal.ModificationOption

type ModificationOptions

type ModificationOptions = internal.ModificationOptions

func NewModificationOptions

func NewModificationOptions(list ...ModificationOption) *ModificationOptions

type NamePath

type NamePath = registrations.NamePath

func NewNamePath

func NewNamePath(p string) NamePath

type OCMContextProvider

type OCMContextProvider interface {
	GetContext() Context
}

type ParseHandler

type ParseHandler func(u *UniformRepositorySpec) error

type PrefixProvider

type PrefixProvider interface {
	PathPrefix() string
}

PrefixProvider is supported by RepositorySpecs to provide info about a potential path prefix to use for globalized local artifacts.

type Repository

type Repository = internal.Repository

type RepositoryAccessMethodChecker

type RepositoryAccessMethodChecker func(Context, compdesc.AccessSpec) bool

type RepositoryDelegationRegistry

type RepositoryDelegationRegistry = internal.RepositoryDelegationRegistry

func DefaultDelegationRegistry

func DefaultDelegationRegistry() RepositoryDelegationRegistry

type RepositorySpec

type RepositorySpec = internal.RepositorySpec

type RepositorySpecDecoder

type RepositorySpecDecoder = internal.RepositorySpecDecoder

type RepositorySpecHandler

type RepositorySpecHandler = internal.RepositorySpecHandler

type RepositorySpecHandlers

type RepositorySpecHandlers = internal.RepositorySpecHandlers

type RepositoryTypeProvider

type RepositoryTypeProvider = internal.RepositoryTypeProvider

type RepositoryTypeScheme

type RepositoryTypeScheme = internal.RepositoryTypeScheme

type RepositoryTypeVersionScheme

type RepositoryTypeVersionScheme = runtime.TypeVersionScheme[RepositorySpec, RepositoryType]

func NewRepositoryTypeVersionScheme

func NewRepositoryTypeVersionScheme(kind string) RepositoryTypeVersionScheme

type ResourceAccess

type ResourceAccess = internal.ResourceAccess

func NewResourceAccess

func NewResourceAccess(componentVersion ComponentVersionAccess, accessSpec compdesc.AccessSpec, meta ResourceMeta) ResourceAccess

func NewResourceAccessForProvider

func NewResourceAccessForProvider(meta *ResourceMeta, prov AccessProvider) ResourceAccess

type ResourceMeta

type ResourceMeta = internal.ResourceMeta

func NewResourceMeta

func NewResourceMeta(name string, typ string, relation metav1.ResourceRelation) *ResourceMeta

type SourceAccess

type SourceAccess = internal.SourceAccess

func NewSourceAccess

func NewSourceAccess(componentVersion ComponentVersionAccess, accessSpec compdesc.AccessSpec, meta SourceMeta) SourceAccess

func NewSourceAccessForProvider

func NewSourceAccessForProvider(meta *SourceMeta, prov AccessProvider) SourceAccess

type SourceMeta

type SourceMeta = internal.SourceMeta

type StorageContext

type StorageContext = internal.StorageContext

Directories

Path Synopsis
Package repocpi contains the implementation support for repository backends.
Package repocpi contains the implementation support for repository backends.

Jump to

Keyboard shortcuts

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