Documentation ¶
Index ¶
- Constants
- Variables
- func AppendUnique(list *[]BlobDigester, elems ...BlobDigester)
- func AsHandlerRegistrationRegistry(r BlobHandlerRegistry) registrations.HandlerRegistrationRegistry[Context, BlobHandlerOption]
- func CompareRule(r, o ResolverRule) int
- func ErrComponentVersionNotFound(name, version string) error
- func ErrComponentVersionNotFoundWrap(err error, name, version string) error
- func MustRegisterBlobHandler(handler BlobHandler, opts ...BlobHandlerOption)
- func MustRegisterDigester(digester BlobDigester, arttypes ...string)
- func NewStrictAccessTypeScheme(base ...AccessTypeScheme) runtime.VersionedTypeRegistry[AccessSpec, AccessType]
- func RegisterAccessType(atype AccessType)
- func RegisterBlobHandler(handler BlobHandler, opts ...BlobHandlerOption)
- func RegisterBlobHandlerRegistrationHandler(path string, handler BlobHandlerRegistrationHandler)
- func RegisterRepositorySpecHandler(hdlr RepositorySpecHandler, types ...string)
- func RegisterRepositoryType(atype RepositoryType)
- func SetDefaultDigester(d BlobDigester)
- type AccessMethod
- type AccessMethodImpl
- type AccessProvider
- type AccessSpec
- type AccessSpecDecoder
- type AccessSpecRef
- func (a *AccessSpecRef) AccessMethod(access ComponentVersionAccess) (AccessMethod, error)
- func (a *AccessSpecRef) Describe(ctx Context) string
- func (a *AccessSpecRef) Evaluate(ctx Context) (AccessSpec, error)
- func (a *AccessSpecRef) Get() AccessSpec
- func (a *AccessSpecRef) GetKind() string
- func (a *AccessSpecRef) GetType() string
- func (a *AccessSpecRef) GetVersion() string
- func (a *AccessSpecRef) GlobalAccessSpec(ctx Context) AccessSpec
- func (a *AccessSpecRef) IsLocal(ctx Context) bool
- func (a *AccessSpecRef) MarshalJSON() ([]byte, error)
- func (a *AccessSpecRef) Set(spec AccessSpec)
- func (a *AccessSpecRef) UnmarshalJSON(data []byte) error
- func (a *AccessSpecRef) Unwrap() AccessSpec
- type AccessType
- type AccessTypeProvider
- type AccessTypeScheme
- type AddVersionOption
- type AddVersionOptions
- type ArtifactAccess
- type BlobAccess
- type BlobDigester
- type BlobDigesterRegistry
- type BlobHandler
- type BlobHandlerConfig
- type BlobHandlerKey
- type BlobHandlerOption
- type BlobHandlerOptions
- type BlobHandlerProvider
- type BlobHandlerRegistrationHandler
- type BlobHandlerRegistrationRegistry
- type BlobHandlerRegistry
- type BlobModificationOption
- type BlobModificationOptions
- func (o *BlobModificationOptions) ApplyBlobModificationOption(opts *BlobModificationOptions)
- func (m *BlobModificationOptions) ApplyBlobModificationOptions(list ...BlobModificationOption)
- func (o *BlobModificationOptions) ApplyBlobUploadOption(opts *BlobUploadOptions)
- func (o *BlobModificationOptions) ApplyModificationOption(opts *ModificationOptions)
- type BlobOptionImpl
- type BlobUploadOption
- type BlobUploadOptions
- type Builder
- func (b Builder) Bound() (Context, context.Context)
- func (b Builder) New(m ...datacontext.BuilderMode) Context
- func (b Builder) WithAccessTypeScheme(scheme AccessTypeScheme) Builder
- func (b Builder) WithBlobDigesters(reg BlobDigesterRegistry) Builder
- func (b Builder) WithBlobHandlers(reg BlobHandlerRegistry) Builder
- func (b Builder) WithContext(ctx context.Context) Builder
- func (b Builder) WithCredentials(ctx credentials.Context) Builder
- func (b Builder) WithOCIRepositories(ctx oci.Context) Builder
- func (b Builder) WithRepositoryDelegation(reg RepositoryDelegationRegistry) Builder
- func (b Builder) WithRepositorySpecHandlers(reg RepositorySpecHandlers) Builder
- func (b Builder) WithRepositoyTypeScheme(scheme RepositoryTypeScheme) Builder
- type ComponentAccess
- type ComponentLister
- type ComponentReference
- type ComponentResolver
- type ComponentVersionAccess
- type ComponentVersionResolver
- type ConsumerIdentityProvider
- type Context
- type ContextProvider
- type DataAccess
- type DelegationRegistry
- type DigestDescriptor
- type DigestSpecProvider
- type DigesterType
- type ElemModOptionImpl
- type ElementModificationOption
- type ElementModificationOptions
- func (m *ElementModificationOptions) ApplyBlobModificationOption(opts *BlobModificationOptions)
- func (m *ElementModificationOptions) ApplyElementModificationOption(opts *ElementModificationOptions)
- func (m *ElementModificationOptions) ApplyElementModificationOptions(list ...ElementModificationOption) *ElementModificationOptions
- func (m *ElementModificationOptions) ApplyModificationOption(opts *ModificationOptions)
- func (m *ElementModificationOptions) IsModifyElement(def ...bool) bool
- type EvaluatableAccessSpec
- type GenericAccessSpec
- func (s *GenericAccessSpec) AccessMethod(acc ComponentVersionAccess) (AccessMethod, error)
- func (s *GenericAccessSpec) Describe(ctx Context) string
- func (s *GenericAccessSpec) Evaluate(ctx Context) (AccessSpec, error)
- func (s *GenericAccessSpec) GlobalAccessSpec(ctx Context) AccessSpec
- func (s *GenericAccessSpec) IsLocal(ctx Context) bool
- type GenericRepositorySpec
- func (s *GenericRepositorySpec) AsUniformSpec(ctx Context) *UniformRepositorySpec
- func (s *GenericRepositorySpec) Evaluate(ctx Context) (RepositorySpec, error)
- func (s *GenericRepositorySpec) Repository(ctx Context, creds credentials.Credentials) (Repository, error)
- func (s *GenericRepositorySpec) Validate(ctx Context, creds credentials.Credentials, ...) error
- type GlobalAccessProvider
- type Hasher
- type HasherProvider
- type HintProvider
- type ImplementationRepositoryType
- type IntermediateRepositorySpecAspect
- type LocalContextProvider
- type MatchingResolver
- func (r *MatchingResolver) AddRule(prefix string, spec RepositorySpec, prio ...int)
- func (r *MatchingResolver) Finalize() error
- func (r *MatchingResolver) GetRules() []ResolverRule
- func (r *MatchingResolver) HasRules() bool
- func (r *MatchingResolver) LookupComponentProviders(name string) []ResolvedComponentProvider
- func (r *MatchingResolver) LookupComponentVersion(name string, version string) (ComponentVersionAccess, error)
- func (r *MatchingResolver) OCMContext() Context
- type MimeType
- type ModOptionImpl
- func AcceptExistentDigests(flag ...bool) ModOptionImpl
- func ModifyResource(flag ...bool) ModOptionImpl
- func SkipDigest(flag ...bool) ModOptionImpldeprecated
- func SkipVerify(flag ...bool) ModOptionImpl
- func WithDefaultHashAlgorithm(algo ...string) ModOptionImpl
- func WithHasherProvider(prov HasherProvider) ModOptionImpl
- type ModificationOption
- type ModificationOptions
- func (m *ModificationOptions) ApplyBlobModificationOption(opts *BlobModificationOptions)
- func (m *ModificationOptions) ApplyModificationOption(opts *ModificationOptions)
- func (m *ModificationOptions) ApplyModificationOptions(list ...ModificationOption) *ModificationOptions
- func (m *ModificationOptions) GetHasher(algo ...string) Hasher
- func (m *ModificationOptions) IsAcceptExistentDigests() bool
- func (m *ModificationOptions) IsSkipDigest() bool
- func (m *ModificationOptions) IsSkipVerify() bool
- type MultiBlobHandler
- type PrioBlobHandler
- type PriorityDecoder
- type ReadOnlyFeature
- type RegistrationHandlerInfo
- type Repository
- type RepositoryCache
- type RepositoryDelegationRegistry
- type RepositoryImpl
- type RepositorySpec
- type RepositorySpecDecoder
- type RepositorySpecHandler
- type RepositorySpecHandlers
- type RepositoryType
- type RepositoryTypeProvider
- type RepositoryTypeScheme
- type ResolvedComponentProvider
- type ResolvedComponentVersionProvider
- type ResolverRule
- type ResourceAccess
- type ResourceMeta
- type SourceAccess
- type SourceMeta
- type StorageContext
- type TargetElement
- type TargetElementOption
- type TargetElementOptions
- func (m *TargetElementOptions) ApplyBlobModificationOption(opts *BlobModificationOptions)
- func (m *TargetElementOptions) ApplyElementModificationOption(opts *ElementModificationOptions)
- func (m *TargetElementOptions) ApplyModificationOption(opts *ModificationOptions)
- func (m *TargetElementOptions) ApplyTargetOption(opts *TargetElementOptions)
- func (m *TargetElementOptions) ApplyTargetOptions(list ...TargetElementOption) *TargetElementOptions
- type TargetIdentity
- func (m TargetIdentity) ApplyBlobModificationOption(opts *BlobModificationOptions)
- func (m TargetIdentity) ApplyElementModificationOption(opts *ElementModificationOptions)
- func (m TargetIdentity) ApplyModificationOption(opts *ModificationOptions)
- func (m TargetIdentity) ApplyTargetOption(opts *TargetElementOptions)
- func (m TargetIdentity) GetTargetIndex(elems compdesc.ElementListAccessor, meta accessors.ElementMeta) (int, error)
- type TargetIdentityOrAppend
- func (m TargetIdentityOrAppend) ApplyBlobModificationOption(opts *BlobModificationOptions)
- func (m TargetIdentityOrAppend) ApplyElementModificationOption(opts *ElementModificationOptions)
- func (m TargetIdentityOrAppend) ApplyModificationOption(opts *ModificationOptions)
- func (m TargetIdentityOrAppend) ApplyTargetOption(opts *TargetElementOptions)
- func (m TargetIdentityOrAppend) GetTargetIndex(elems compdesc.ElementListAccessor, meta accessors.ElementMeta) (int, error)
- type TargetIndex
- func (m TargetIndex) ApplyBlobModificationOption(opts *BlobModificationOptions)
- func (m TargetIndex) ApplyElementModificationOption(opts *ElementModificationOptions)
- func (m TargetIndex) ApplyModificationOption(opts *ModificationOptions)
- func (m TargetIndex) ApplyTargetOption(opts *TargetElementOptions)
- func (m TargetIndex) GetTargetIndex(elems compdesc.ElementListAccessor, meta accessors.ElementMeta) (int, error)
- type TargetOptionImpl
- type UniformRepositorySpec
- type UnknownAccessSpec
- func (s *UnknownAccessSpec) AccessMethod(ComponentVersionAccess) (AccessMethod, error)
- func (s *UnknownAccessSpec) Describe(ctx Context) string
- func (_ *UnknownAccessSpec) GlobalAccessSpec(Context) AccessSpec
- func (_ *UnknownAccessSpec) IsLocal(Context) bool
- func (_ *UnknownAccessSpec) IsUnknown() bool
- type UnknownRepositorySpec
- func (r *UnknownRepositorySpec) AsUniformSpec(Context) *UniformRepositorySpec
- func (_ *UnknownRepositorySpec) IsUnknown() bool
- func (r *UnknownRepositorySpec) Repository(Context, credentials.Credentials) (Repository, error)
- func (r *UnknownRepositorySpec) Validate(ctx Context, creds credentials.Credentials, ...) error
Constants ¶
const ( KIND_REPOSITORY = "ocm repository" KIND_REPOSITORYSPEC = "repository specification" KIND_COMPONENT = errkind.KIND_COMPONENT KIND_COMPONENTVERSION = compdesc.KIND_COMPONENTVERSION KIND_RESOURCE = compdesc.KIND_RESOURCE KIND_SOURCE = compdesc.KIND_SOURCE KIND_REFERENCE = compdesc.KIND_REFERENCE KIND_OCM_REFERENCE = "ocm reference" )
const CONTEXT_TYPE = "ocm" + datacontext.OCM_CONTEXT_SUFFIX
const CommonTransportFormat = ctf.Type
const DEFAULT_BLOBHANDLER_PRIO = 100
Variables ¶
var DefaultAccessTypeScheme = NewAccessTypeScheme()
DefaultAccessTypeScheme contains all globally known access serializer.
var DefaultBlobDigesterRegistry = NewBlobDigesterRegistry()
var DefaultBlobHandlerRegistry = NewBlobHandlerRegistry()
var DefaultContext = Builder{}.New(datacontext.MODE_SHARED)
DefaultContext is the default context initialized by init functions.
var DefaultRepositoryDelegationRegistry = NewDelegationRegistry[Context, RepositorySpec]()
var DefaultRepositorySpecHandlers = NewRepositorySpecHandlers()
var DefaultRepositoryTypeScheme = NewRepositoryTypeScheme(nil)
DefaultRepositoryTypeScheme contains all globally known access serializer.
var UpdateElement = replaceElement{}
Functions ¶
func AppendUnique ¶
func AppendUnique(list *[]BlobDigester, elems ...BlobDigester)
func AsHandlerRegistrationRegistry ¶
func AsHandlerRegistrationRegistry(r BlobHandlerRegistry) registrations.HandlerRegistrationRegistry[Context, BlobHandlerOption]
func CompareRule ¶
func CompareRule(r, o ResolverRule) int
func MustRegisterBlobHandler ¶
func MustRegisterBlobHandler(handler BlobHandler, opts ...BlobHandlerOption)
func MustRegisterDigester ¶
func MustRegisterDigester(digester BlobDigester, arttypes ...string)
func NewStrictAccessTypeScheme ¶
func NewStrictAccessTypeScheme(base ...AccessTypeScheme) runtime.VersionedTypeRegistry[AccessSpec, AccessType]
func RegisterAccessType ¶
func RegisterAccessType(atype AccessType)
func RegisterBlobHandler ¶
func RegisterBlobHandler(handler BlobHandler, opts ...BlobHandlerOption)
func RegisterBlobHandlerRegistrationHandler ¶
func RegisterBlobHandlerRegistrationHandler(path string, handler BlobHandlerRegistrationHandler)
func RegisterRepositorySpecHandler ¶
func RegisterRepositorySpecHandler(hdlr RepositorySpecHandler, types ...string)
func RegisterRepositoryType ¶
func RegisterRepositoryType(atype RepositoryType)
func SetDefaultDigester ¶
func SetDefaultDigester(d BlobDigester)
Types ¶
type AccessMethod ¶
type AccessMethod interface { refmgmt.Dup[AccessMethod] AccessMethodImpl // AsBlobAccess maps a method object into a // basic blob access interface. // It does not provide a separate reference, // closing the blob access will close the // access method. AsBlobAccess() BlobAccess }
AccessMethod is used to support independently closable views on an access method implementation, which can be passed around and stored. The original method implementation object is closed once the last view is closed.
type AccessMethodImpl ¶
type AccessMethodImpl interface { io.Closer DataAccess MimeType IsLocal() bool GetKind() string AccessSpec() AccessSpec }
AccessMethodImpl is the implementation interface for access methods provided by access types. It describes the access to a dedicated resource It can allocate external resources, which should be released with the Close() call. Resources SHOULD only be allocated, if the content is accessed via the DataAccess interface to avoid unnecessary effort if the method object is just used to access meta data. It is always wrapped by a view model enabling Dup operations to pass and keep instances on demand.
type AccessProvider ¶
type AccessProvider interface { GetOCMContext() Context ReferenceHint() string Access() (AccessSpec, error) AccessMethod() (AccessMethod, error) GlobalAccess() AccessSpec blobaccess.BlobAccessProvider }
AccessProvider assembled methods provided and used for access methods. It is provided for resources in a component version with the base support implementation in package cpi. But it can also be provided by resource provisioners used to feed the ComponentVersionAccess.SetResourceByAccess or the ComponentVersionAccessSetSourceByAccess method.
type AccessSpec ¶
type AccessSpec interface { compdesc.AccessSpec Describe(Context) string IsLocal(Context) bool GlobalAccessSpec(Context) AccessSpec // AccessMethod provides an access method implementation for // an access spec. This might be a repository local implementation // or a global one. It might be implemented directly by the AccessSpec // for global AccessMethods or forwarded to the ComponentVersion for // local access methods. It may only be forwarded for AccessSpecs stating // to be local (IsLocal()==true). // This forwarding is necessary because the concrete implementation of // the currently used OCM Repository is not known to the AccessSpec. AccessMethod(access ComponentVersionAccess) (AccessMethod, error) }
AccessSpec is the interface access method specifications must fulfill. The main task is to map the specification to a concrete implementation of the access method for a dedicated component version.
func CreateAccessSpec ¶
func CreateAccessSpec(t runtime.TypedObject) (AccessSpec, error)
func NewGenericAccessSpec ¶
func NewGenericAccessSpec(data []byte, unmarshaler ...runtime.Unmarshaler) (AccessSpec, error)
type AccessSpecDecoder ¶
type AccessSpecDecoder = runtime.TypedObjectDecoder[AccessSpec]
type AccessSpecRef ¶
type AccessSpecRef struct {
// contains filtered or unexported fields
}
func NewAccessSpecRef ¶
func NewAccessSpecRef(spec AccessSpec) *AccessSpecRef
func NewRawAccessSpecRef ¶
func NewRawAccessSpecRef(data []byte, unmarshaler runtime.Unmarshaler) (*AccessSpecRef, error)
func (*AccessSpecRef) AccessMethod ¶
func (a *AccessSpecRef) AccessMethod(access ComponentVersionAccess) (AccessMethod, error)
func (*AccessSpecRef) Describe ¶
func (a *AccessSpecRef) Describe(ctx Context) string
func (*AccessSpecRef) Evaluate ¶
func (a *AccessSpecRef) Evaluate(ctx Context) (AccessSpec, error)
func (*AccessSpecRef) Get ¶
func (a *AccessSpecRef) Get() AccessSpec
func (*AccessSpecRef) GetKind ¶
func (a *AccessSpecRef) GetKind() string
func (*AccessSpecRef) GetType ¶
func (a *AccessSpecRef) GetType() string
func (*AccessSpecRef) GetVersion ¶
func (a *AccessSpecRef) GetVersion() string
func (*AccessSpecRef) GlobalAccessSpec ¶
func (a *AccessSpecRef) GlobalAccessSpec(ctx Context) AccessSpec
func (*AccessSpecRef) IsLocal ¶
func (a *AccessSpecRef) IsLocal(ctx Context) bool
func (*AccessSpecRef) MarshalJSON ¶
func (a *AccessSpecRef) MarshalJSON() ([]byte, error)
MarshalJSON implements a custom json unmarshal method for a unstructured type.
func (*AccessSpecRef) Set ¶
func (a *AccessSpecRef) Set(spec AccessSpec)
func (*AccessSpecRef) UnmarshalJSON ¶
func (a *AccessSpecRef) UnmarshalJSON(data []byte) error
UnmarshalJSON implements a custom json unmarshal method for an access spec ref.
func (*AccessSpecRef) Unwrap ¶
func (a *AccessSpecRef) Unwrap() AccessSpec
type AccessType ¶
type AccessType flagsetscheme.VersionTypedObjectType[AccessSpec]
type AccessTypeProvider ¶
type AccessTypeProvider = runtime.KnownTypesProvider[AccessSpec, AccessType]
type AccessTypeScheme ¶
type AccessTypeScheme flagsetscheme.TypeScheme[AccessSpec, AccessType]
func NewAccessTypeScheme ¶
func NewAccessTypeScheme(base ...AccessTypeScheme) AccessTypeScheme
type AddVersionOption ¶
type AddVersionOption interface {
ApplyAddVersionOption(*AddVersionOptions)
}
BlobModificationOption is used for option list allowing both, blob upload and modification options.
func Overwrite ¶
func Overwrite(flag ...bool) AddVersionOption
Overwrite enabled the overwrite mode for adding a component version.
type AddVersionOptions ¶
type AddVersionOptions struct { Overwrite *bool BlobUploadOptions }
func NewAddVersionOptions ¶
func NewAddVersionOptions(list ...AddVersionOption) *AddVersionOptions
func (*AddVersionOptions) ApplyAddVersionOption ¶
func (o *AddVersionOptions) ApplyAddVersionOption(opts *AddVersionOptions)
func (*AddVersionOptions) ApplyAddVersionOptions ¶
func (m *AddVersionOptions) ApplyAddVersionOptions(list ...AddVersionOption)
type ArtifactAccess ¶
type ArtifactAccess[M any] interface { Meta() *M GetComponentVersion() (ComponentVersionAccess, error) AccessProvider }
type BlobAccess ¶
type BlobAccess = blobaccess.BlobAccess
type BlobDigester ¶
type BlobDigester interface { GetType() DigesterType DetermineDigest(resType string, meth AccessMethod, preferred Hasher) (*DigestDescriptor, error) }
BlobDigester is the interface for digest providers for dedicated mime types. If found the digest provided by the digester will replace the standard digest calculated for the byte content of the blob.
type BlobDigesterRegistry ¶
type BlobDigesterRegistry interface { IsInitial() bool // MustRegisterDigester registers a blob digester for a dedicated exact mime type // Register(handler BlobDigester, restypes ...string) error // GetDigester returns the digester for a given type GetDigester(typ DigesterType) BlobDigester GetDigesterForType(t string) []BlobDigester DetermineDigests(typ string, preferred signing.Hasher, registry HasherProvider, acc AccessMethod, typs ...DigesterType) ([]DigestDescriptor, error) Copy() BlobDigesterRegistry }
BlobDigesterRegistry registers blob handlers to use in a dedicated ocm context.
func NewBlobDigesterRegistry ¶
func NewBlobDigesterRegistry(base ...BlobDigesterRegistry) BlobDigesterRegistry
type BlobHandler ¶
type BlobHandler interface { // StoreBlob has the chance to decide to store a local blob // in a repository specific fashion providing external access. // If this is possible and done an appropriate access spec // must be returned, if this is not done, nil has to be returned // without error StoreBlob(blob BlobAccess, artType, hint string, global AccessSpec, ctx StorageContext) (AccessSpec, error) }
BlobHandler is the interface for a dedicated handling of storing blobs for the LocalBlob access method in a dedicated kind of repository. With the possibility of access by an external distribution spec (besides of the blob storage as part of a component version). The technical repository to use should be derivable from the chosen component directory or passed together with the storage context. The task of the handler is to store the local blob on its own responsibility and to return an appropriate global access method.
type BlobHandlerConfig ¶
type BlobHandlerConfig = registrations.HandlerConfig
type BlobHandlerKey ¶
type BlobHandlerKey struct { ImplementationRepositoryType `json:",inline"` ArtifactType string `json:"artifactType,omitempty"` MimeType string `json:"mimeType,omitempty"` }
BlobHandlerKey is the registration key for BlobHandlers.
func NewBlobHandlerKey ¶
func NewBlobHandlerKey(ctxtype, repotype, artifactType, mimetype string) BlobHandlerKey
func (BlobHandlerKey) ApplyBlobHandlerOptionTo ¶
func (k BlobHandlerKey) ApplyBlobHandlerOptionTo(opts *BlobHandlerOptions)
type BlobHandlerOption ¶
type BlobHandlerOption interface {
ApplyBlobHandlerOptionTo(*BlobHandlerOptions)
}
func ForArtifactType ¶
func ForArtifactType(artifacttype string) BlobHandlerOption
func ForMimeType ¶
func ForMimeType(mimetype string) BlobHandlerOption
func ForRepo ¶
func ForRepo(ctxtype, repotype string) BlobHandlerOption
func WithPrio ¶
func WithPrio(p int) BlobHandlerOption
type BlobHandlerOptions ¶
type BlobHandlerOptions struct { BlobHandlerKey `json:",inline"` Priority int `json:"priority,omitempty"` }
func NewBlobHandlerOptions ¶
func NewBlobHandlerOptions(olist ...BlobHandlerOption) *BlobHandlerOptions
func (*BlobHandlerOptions) ApplyBlobHandlerOptionTo ¶
func (o *BlobHandlerOptions) ApplyBlobHandlerOptionTo(opts *BlobHandlerOptions)
type BlobHandlerProvider ¶
type BlobHandlerProvider interface {
LookupHandler(sctx StorageContext, artifacttype, mimeType string) BlobHandler
}
BlobHandlerProvider is used to find a blob handler to use adding a resource blob to a component version. The task of the BlobHandler is to reject the upload, provide an (external) access method for the blob or state not to be responsible.
func BlobHandlerProviderForRegistry ¶
func BlobHandlerProviderForRegistry(r BlobHandlerRegistry) BlobHandlerProvider
func DefaultBlobHandlerProvider ¶
func DefaultBlobHandlerProvider(ctx Context) BlobHandlerProvider
type BlobHandlerRegistrationHandler ¶
type BlobHandlerRegistrationHandler = registrations.HandlerRegistrationHandler[Context, BlobHandlerOption]
type BlobHandlerRegistrationRegistry ¶
type BlobHandlerRegistrationRegistry = registrations.HandlerRegistrationRegistry[Context, BlobHandlerOption]
func NewBlobHandlerRegistrationRegistry ¶
func NewBlobHandlerRegistrationRegistry(base ...BlobHandlerRegistrationRegistry) BlobHandlerRegistrationRegistry
type BlobHandlerRegistry ¶
type BlobHandlerRegistry interface { AsHandlerRegistrationRegistry() registrations.HandlerRegistrationRegistry[Context, BlobHandlerOption] // BlobHandlerRegistrationRegistry registrations.HandlerRegistrationRegistryAccess[Context, BlobHandlerOption] IsInitial() bool // Copy provides a new independend copy of the registry. Copy() BlobHandlerRegistry // RegisterBlobHandler registers a blob handler. It must specify either a sole mime type, // or a context and repository type, or all three keys. Register(handler BlobHandler, opts ...BlobHandlerOption) BlobHandlerRegistry // GetHandler returns the handler with the given key. GetHandler(key BlobHandlerKey) BlobHandler // LookupHandler returns handler trying all matches in the following order: // // - a handler matching all keys // - handlers matching the repo and mime type (from specific to more general by discarding + components) // - with artifact type // - without artifact type // - handlers matching artifact type // - handlers matching a sole mimetype handler (from specific to more general by discarding + components) // - a handler matching the repo // LookupHandler(repotype ImplementationRepositoryType, artifacttype, mimeType string) BlobHandler }
BlobHandlerRegistry registers blob handlers to use in a dedicated ocm context.
func NewBlobHandlerRegistry ¶
func NewBlobHandlerRegistry(base ...BlobHandlerRegistry) BlobHandlerRegistry
type BlobModificationOption ¶
type BlobModificationOption interface {
ApplyBlobModificationOption(*BlobModificationOptions)
}
BlobModificationOption is used for option list allowing both, blob upload and modification options.
type BlobModificationOptions ¶
type BlobModificationOptions struct { BlobUploadOptions ModificationOptions }
func NewBlobModificationOptions ¶
func NewBlobModificationOptions(list ...BlobModificationOption) *BlobModificationOptions
func (*BlobModificationOptions) ApplyBlobModificationOption ¶
func (o *BlobModificationOptions) ApplyBlobModificationOption(opts *BlobModificationOptions)
func (*BlobModificationOptions) ApplyBlobModificationOptions ¶
func (m *BlobModificationOptions) ApplyBlobModificationOptions(list ...BlobModificationOption)
func (*BlobModificationOptions) ApplyBlobUploadOption ¶
func (o *BlobModificationOptions) ApplyBlobUploadOption(opts *BlobUploadOptions)
func (*BlobModificationOptions) ApplyModificationOption ¶
func (o *BlobModificationOptions) ApplyModificationOption(opts *ModificationOptions)
type BlobOptionImpl ¶
type BlobOptionImpl interface { BlobUploadOption BlobModificationOption }
func UseBlobHandlers ¶
func UseBlobHandlers(h BlobHandlerProvider) BlobOptionImpl
func UseNoDefaultBlobHandlers ¶
func UseNoDefaultBlobHandlers(b ...bool) BlobOptionImpl
type BlobUploadOption ¶
type BlobUploadOption interface {
ApplyBlobUploadOption(opts *BlobUploadOptions)
}
type BlobUploadOptions ¶
type BlobUploadOptions struct { UseNoDefaultIfNotSet *bool `json:"noDefaultUpload,omitempty"` BlobHandlerProvider BlobHandlerProvider `json:"-"` }
func NewBlobUploadOptions ¶
func NewBlobUploadOptions(list ...BlobUploadOption) *BlobUploadOptions
func (*BlobUploadOptions) ApplyBlobModificationOption ¶
func (o *BlobUploadOptions) ApplyBlobModificationOption(opts *BlobModificationOptions)
func (*BlobUploadOptions) ApplyBlobUploadOption ¶
func (o *BlobUploadOptions) ApplyBlobUploadOption(opts *BlobUploadOptions)
func (*BlobUploadOptions) ApplyBlobUploadOptions ¶
func (m *BlobUploadOptions) ApplyBlobUploadOptions(list ...BlobUploadOption)
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (Builder) New ¶
func (b Builder) New(m ...datacontext.BuilderMode) Context
func (Builder) WithAccessTypeScheme ¶
func (b Builder) WithAccessTypeScheme(scheme AccessTypeScheme) Builder
func (Builder) WithBlobDigesters ¶
func (b Builder) WithBlobDigesters(reg BlobDigesterRegistry) Builder
func (Builder) WithBlobHandlers ¶
func (b Builder) WithBlobHandlers(reg BlobHandlerRegistry) Builder
func (Builder) WithCredentials ¶
func (b Builder) WithCredentials(ctx credentials.Context) Builder
func (Builder) WithRepositoryDelegation ¶
func (b Builder) WithRepositoryDelegation(reg RepositoryDelegationRegistry) Builder
func (Builder) WithRepositorySpecHandlers ¶
func (b Builder) WithRepositorySpecHandlers(reg RepositorySpecHandlers) Builder
func (Builder) WithRepositoyTypeScheme ¶
func (b Builder) WithRepositoyTypeScheme(scheme RepositoryTypeScheme) Builder
type ComponentAccess ¶
type ComponentAccess interface { resource.ResourceView[ComponentAccess] GetContext() Context GetName() string ListVersions() ([]string, error) LookupVersion(version string) (ComponentVersionAccess, error) HasVersion(vers string) (bool, error) NewVersion(version string, overrides ...bool) (ComponentVersionAccess, error) AddVersion(cv ComponentVersionAccess, overrides ...bool) error AddVersionOpt(cv ComponentVersionAccess, opts ...AddVersionOption) error io.Closer }
type ComponentLister ¶
type ComponentLister interface { // NumComponents returns the number of components found for a prefix // If the given prefix does not end with a /, a repository with the // prefix name is included NumComponents(prefix string) (int, error) // GetNamespaces returns the name of namespaces found for a prefix // If the given prefix does not end with a /, a repository with the // prefix name is included GetComponents(prefix string, closure bool) ([]string, error) }
ComponentLister provides the optional repository list functionality of a repository.
type ComponentReference ¶
type ComponentResolver ¶
type ComponentResolver interface {
LookupComponentProviders(name string) []ResolvedComponentProvider
}
ComponentResolver is an optional interface for a ComponentVersionResolver, which can offer information about potential providers usable to lookup versions for a dedicated component.
Be careful, provided objects may refer to closable objects held by the interface provider. They should only be used as long as the object behind the ComponentResolver is not closed.
type ComponentVersionAccess ¶
type ComponentVersionAccess interface { resource.ResourceView[ComponentVersionAccess] common.VersionedElement io.Closer ReadOnlyFeature GetContext() Context Repository() Repository GetDescriptor() *compdesc.ComponentDescriptor DiscardChanges() IsPersistent() bool GetProvider() *compdesc.Provider SetProvider(provider *compdesc.Provider) error GetResource(meta metav1.Identity) (ResourceAccess, error) GetResourceIndex(meta metav1.Identity) int GetResourceByIndex(i int) (ResourceAccess, error) GetResources() []ResourceAccess SelectResources(sel ...rscsel.Selector) ([]ResourceAccess, error) SetResource(*ResourceMeta, compdesc.AccessSpec, ...ModificationOption) error SetResourceByAccess(art ResourceAccess, modopts ...BlobModificationOption) error GetSource(meta metav1.Identity) (SourceAccess, error) GetSourceIndex(meta metav1.Identity) int GetSourceByIndex(i int) (SourceAccess, error) GetSources() []SourceAccess SelectSources(sel ...srcsel.Selector) ([]SourceAccess, error) // SetSource updates or sets anew source. The options only use the // target options. All other options are ignored. SetSource(*SourceMeta, compdesc.AccessSpec, ...TargetElementOption) error // SetSourceByAccess updates or sets anew source. The options only use the // target options. All other options are ignored. SetSourceByAccess(art SourceAccess, opts ...TargetElementOption) error GetReference(meta metav1.Identity) (ComponentReference, error) GetReferenceIndex(meta metav1.Identity) int GetReferenceByIndex(i int) (ComponentReference, error) GetReferences() []ComponentReference SelectReferences(sel ...refsel.Selector) ([]ComponentReference, error) // SetReference adds or updates a reference. By default, it does not allow for // signature relevant changes. If such operations should be possible // the option ModifyElement() has to be passed as option. SetReference(ref *ComponentReference, opts ...ElementModificationOption) error // AddBlob adds a local blob and returns an appropriate local access spec. AddBlob(blob BlobAccess, artType, refName string, global AccessSpec, opts ...BlobUploadOption) (AccessSpec, error) // AdjustResourceAccess is used to modify the access spec. The old and new one MUST refer to the same content. AdjustResourceAccess(meta *ResourceMeta, acc compdesc.AccessSpec, opts ...ModificationOption) error SetResourceBlob(meta *ResourceMeta, blob BlobAccess, refname string, global AccessSpec, opts ...BlobModificationOption) error AdjustSourceAccess(meta *SourceMeta, acc compdesc.AccessSpec) error // SetSourceBlob updates or sets anew source. The options only use the // target options. All other options are ignored. SetSourceBlob(meta *SourceMeta, blob BlobAccess, refname string, global AccessSpec, opts ...TargetElementOption) error // AccessMethod provides an access method implementation for // an access spec. This might be a repository local implementation // or a global one. It might be called by the AccessSpec method // to map itself to a local implementation or called directly. // If called it should forward the call to the AccessSpec // if and only if this specs NOT states to be local IsLocal()==false // If the spec states to be local, the repository is responsible for // providing a local implementation or return nil if this is // not supported by the actual repository type. AccessMethod(AccessSpec) (AccessMethod, error) // Update adds the version with all changes to the component instance it has been created for. Update() error // Execute executes a function on a valid and locked component version reference. // If it returns an error this error is forwarded. Execute(func() error) error }
type ComponentVersionResolver ¶
type ComponentVersionResolver interface {
LookupComponentVersion(name string, version string) (ComponentVersionAccess, error)
}
ComponentVersionResolver describes an object able to map component version identities to a component version access, the representtaion of the component version stored in a dedicated OCM repository. Such a resolver might optionally implement the ComponentResolver interface to provide information about potential locations for a particular component.
type ConsumerIdentityProvider ¶
type ConsumerIdentityProvider = credentials.ConsumerIdentityProvider
ConsumerIdentityProvider is an interface for object requiring credentials, which want to expose the ConsumerId they are usingto request implicit credentials.
type Context ¶
type Context interface { datacontext.Context config.ContextProvider credentials.ContextProvider oci.ContextProvider ContextProvider RepositoryTypes() RepositoryTypeScheme AccessMethods() AccessTypeScheme RepositorySpecHandlers() RepositorySpecHandlers MapUniformRepositorySpec(u *UniformRepositorySpec) (RepositorySpec, error) DisableBlobHandlers() BlobHandlers() BlobHandlerRegistry BlobDigesters() BlobDigesterRegistry RepositoryForSpec(spec RepositorySpec, creds ...credentials.CredentialsSource) (Repository, error) RepositoryForConfig(data []byte, unmarshaler runtime.Unmarshaler, creds ...credentials.CredentialsSource) (Repository, error) RepositorySpecForConfig(data []byte, unmarshaler runtime.Unmarshaler) (RepositorySpec, error) AccessSpecForSpec(spec compdesc.AccessSpec) (AccessSpec, error) AccessSpecForConfig(data []byte, unmarshaler runtime.Unmarshaler) (AccessSpec, error) Encode(AccessSpec, runtime.Marshaler) ([]byte, error) GetAlias(name string) RepositorySpec SetAlias(name string, spec RepositorySpec) GetResolver() ComponentVersionResolver AddResolverRule(prefix string, spec RepositorySpec, prio ...int) // Finalize finalizes elements implicitly opened during resource operations. // For example, registered blob handler may open objects, which are kept open // for performance reasons. At the end of a usage finalize should be called // to finalize those elements. This method can be called any time by a context // user to cleanup temporarily allocated resources. Therefore, only // elements should be added to the finalzer, which can be reopened/created // on-the fly whenever required. Finalize() error Finalizer() *Finalizer }
func FromContext ¶
FromContext returns the Context to use for context.Context. This is either an explicit context or the default context.
func FromProvider ¶
func FromProvider(p ContextProvider) Context
type ContextProvider ¶
type ContextProvider interface {
OCMContext() Context
}
func WrapContextProvider ¶
func WrapContextProvider(ctx LocalContextProvider) ContextProvider
type DataAccess ¶
type DataAccess = blobaccess.DataAccess
type DelegationRegistry ¶
type DelegationRegistry[C any, T runtime.TypedObject] interface { Register(name string, decoder PriorityDecoder[C, T]) Get(name string) PriorityDecoder[C, T] Delegations() map[string]PriorityDecoder[C, T] Decode(ctx C, data []byte, unmarshaller runtime.Unmarshaler) (T, error) Copy() DelegationRegistry[C, T] }
func NewDelegationRegistry ¶
func NewDelegationRegistry[C any, T runtime.TypedObject](base ...DelegationRegistry[C, T]) DelegationRegistry[C, T]
type DigestDescriptor ¶
type DigestDescriptor = metav1.DigestSpec
func NewDigestDescriptor ¶
func NewDigestDescriptor(digest, hashAlgo, normAlgo string) *DigestDescriptor
type DigestSpecProvider ¶ added in v0.15.0
type DigestSpecProvider interface {
GetDigestSpec() (*metav1.DigestSpec, error)
}
DigestSpecProvider is an optional interface for an access method to provide am Digest Specification.
type DigesterType ¶
func (DigesterType) IsInitial ¶
func (d DigesterType) IsInitial() bool
func (DigesterType) Normalize ¶
func (d DigesterType) Normalize() DigesterType
func (DigesterType) String ¶
func (d DigesterType) String() string
type ElemModOptionImpl ¶ added in v0.19.0
type ElemModOptionImpl interface { ElementModificationOption ModificationOption BlobModificationOption }
func ModifyElement ¶ added in v0.19.0
func ModifyElement(flag ...bool) ElemModOptionImpl
type ElementModificationOption ¶ added in v0.19.0
type ElementModificationOption interface {
ApplyElementModificationOption(opts *ElementModificationOptions)
}
type ElementModificationOptions ¶ added in v0.19.0
type ElementModificationOptions struct { TargetElementOptions // ModifyElement disables the modification of signature relevant // resource parts. ModifyElement *bool }
func NewElementModificationOptions ¶ added in v0.19.0
func NewElementModificationOptions(list ...ElementModificationOption) *ElementModificationOptions
func (*ElementModificationOptions) ApplyBlobModificationOption ¶ added in v0.19.0
func (m *ElementModificationOptions) ApplyBlobModificationOption(opts *BlobModificationOptions)
func (*ElementModificationOptions) ApplyElementModificationOption ¶ added in v0.19.0
func (m *ElementModificationOptions) ApplyElementModificationOption(opts *ElementModificationOptions)
func (*ElementModificationOptions) ApplyElementModificationOptions ¶ added in v0.19.0
func (m *ElementModificationOptions) ApplyElementModificationOptions(list ...ElementModificationOption) *ElementModificationOptions
func (*ElementModificationOptions) ApplyModificationOption ¶ added in v0.19.0
func (m *ElementModificationOptions) ApplyModificationOption(opts *ModificationOptions)
func (*ElementModificationOptions) IsModifyElement ¶ added in v0.19.0
func (m *ElementModificationOptions) IsModifyElement(def ...bool) bool
type EvaluatableAccessSpec ¶
type EvaluatableAccessSpec interface { AccessSpec Evaluate(ctx Context) (AccessSpec, error) }
type GenericAccessSpec ¶
type GenericAccessSpec struct {
runtime.UnstructuredVersionedTypedObject `json:",inline"`
}
func ToGenericAccessSpec ¶
func ToGenericAccessSpec(spec AccessSpec) (*GenericAccessSpec, error)
func (*GenericAccessSpec) AccessMethod ¶
func (s *GenericAccessSpec) AccessMethod(acc ComponentVersionAccess) (AccessMethod, error)
func (*GenericAccessSpec) Describe ¶
func (s *GenericAccessSpec) Describe(ctx Context) string
func (*GenericAccessSpec) Evaluate ¶
func (s *GenericAccessSpec) Evaluate(ctx Context) (AccessSpec, error)
func (*GenericAccessSpec) GlobalAccessSpec ¶
func (s *GenericAccessSpec) GlobalAccessSpec(ctx Context) AccessSpec
func (*GenericAccessSpec) IsLocal ¶
func (s *GenericAccessSpec) IsLocal(ctx Context) bool
type GenericRepositorySpec ¶
type GenericRepositorySpec struct {
runtime.UnstructuredVersionedTypedObject `json:",inline"`
}
func ToGenericRepositorySpec ¶
func ToGenericRepositorySpec(spec RepositorySpec) (*GenericRepositorySpec, error)
func (*GenericRepositorySpec) AsUniformSpec ¶
func (s *GenericRepositorySpec) AsUniformSpec(ctx Context) *UniformRepositorySpec
func (*GenericRepositorySpec) Evaluate ¶
func (s *GenericRepositorySpec) Evaluate(ctx Context) (RepositorySpec, error)
func (*GenericRepositorySpec) Repository ¶
func (s *GenericRepositorySpec) Repository(ctx Context, creds credentials.Credentials) (Repository, error)
func (*GenericRepositorySpec) Validate ¶
func (s *GenericRepositorySpec) Validate(ctx Context, creds credentials.Credentials, context ...credentials.UsageContext) error
type GlobalAccessProvider ¶
type GlobalAccessProvider interface {
GlobalAccessSpec(ctx Context) AccessSpec
}
GlobalAccessProvider is used to provide a non-local access specification. It may optionally be provided by an access spec.
type HasherProvider ¶
type HasherProvider = signing.HasherProvider
HasherProvider provides access to supported hash methods.
type HintProvider ¶
type HintProvider interface {
GetReferenceHint(cv ComponentVersionAccess) string
}
HintProvider is used to provide a reference hint for local access method specs. It may optionally be provided by an access spec. When adding blobs to a repository the hint is used by blobhandlers for expanding a blob to a repository specific representation to determine a useful name.
type ImplementationRepositoryType ¶
type ImplementationRepositoryType struct { ContextType string `json:"contextType,omitempty"` RepositoryType string `json:"repositoryType,omitempty"` }
func (ImplementationRepositoryType) IsInitial ¶
func (t ImplementationRepositoryType) IsInitial() bool
func (ImplementationRepositoryType) String ¶
func (t ImplementationRepositoryType) String() string
type IntermediateRepositorySpecAspect ¶
type IntermediateRepositorySpecAspect = oci.IntermediateRepositorySpecAspect
type LocalContextProvider ¶
type LocalContextProvider interface {
GetContext() Context
}
type MatchingResolver ¶
type MatchingResolver struct {
// contains filtered or unexported fields
}
MatchingResolver hosts rule to match component version names. Matched names will be mapped to a specification for repository which should be used to look up the component version. Therefore, it keeps a reference to the context to use.
ATTENTION: Because such an object is used by the context implementation, the context must be kept as ContextProvider to provide context views to outbound calls.
func NewMatchingResolver ¶
func NewMatchingResolver(ctx ContextProvider, rules ...ResolverRule) *MatchingResolver
func (*MatchingResolver) AddRule ¶
func (r *MatchingResolver) AddRule(prefix string, spec RepositorySpec, prio ...int)
func (*MatchingResolver) Finalize ¶
func (r *MatchingResolver) Finalize() error
func (*MatchingResolver) GetRules ¶
func (r *MatchingResolver) GetRules() []ResolverRule
func (*MatchingResolver) HasRules ¶ added in v0.15.0
func (r *MatchingResolver) HasRules() bool
func (*MatchingResolver) LookupComponentProviders ¶
func (r *MatchingResolver) LookupComponentProviders(name string) []ResolvedComponentProvider
func (*MatchingResolver) LookupComponentVersion ¶
func (r *MatchingResolver) LookupComponentVersion(name string, version string) (ComponentVersionAccess, error)
func (*MatchingResolver) OCMContext ¶
func (r *MatchingResolver) OCMContext() Context
type MimeType ¶
type MimeType = blobaccess.MimeType
type ModOptionImpl ¶
type ModOptionImpl interface { ModificationOption BlobModificationOption }
func AcceptExistentDigests ¶
func AcceptExistentDigests(flag ...bool) ModOptionImpl
func ModifyResource ¶
func ModifyResource(flag ...bool) ModOptionImpl
func SkipDigest
deprecated
func SkipDigest(flag ...bool) ModOptionImpl
SkipDigest disables digest creation if enabled.
Deprecated: for legacy code, only.
func SkipVerify ¶
func SkipVerify(flag ...bool) ModOptionImpl
func WithDefaultHashAlgorithm ¶
func WithDefaultHashAlgorithm(algo ...string) ModOptionImpl
func WithHasherProvider ¶
func WithHasherProvider(prov HasherProvider) ModOptionImpl
type ModificationOption ¶
type ModificationOption interface {
ApplyModificationOption(opts *ModificationOptions)
}
type ModificationOptions ¶
type ModificationOptions struct { ElementModificationOptions // AcceptExistentDigests don't validate/recalculate the content digest // of resources. AcceptExistentDigests *bool // DefaultHashAlgorithm is the hash algorithm to use if no specific setting os found DefaultHashAlgorithm string // HasherProvider is the factory for hash algorithms to use. HasherProvider HasherProvider // SkipVerify disabled the verification of given digests SkipVerify *bool // SkipDigest disabled digest creation (for legacy code, only!) SkipDigest *bool }
func NewModificationOptions ¶
func NewModificationOptions(list ...ModificationOption) *ModificationOptions
func (*ModificationOptions) ApplyBlobModificationOption ¶
func (m *ModificationOptions) ApplyBlobModificationOption(opts *BlobModificationOptions)
func (*ModificationOptions) ApplyModificationOption ¶
func (m *ModificationOptions) ApplyModificationOption(opts *ModificationOptions)
func (*ModificationOptions) ApplyModificationOptions ¶
func (m *ModificationOptions) ApplyModificationOptions(list ...ModificationOption) *ModificationOptions
func (*ModificationOptions) GetHasher ¶
func (m *ModificationOptions) GetHasher(algo ...string) Hasher
func (*ModificationOptions) IsAcceptExistentDigests ¶
func (m *ModificationOptions) IsAcceptExistentDigests() bool
func (*ModificationOptions) IsSkipDigest ¶
func (m *ModificationOptions) IsSkipDigest() bool
func (*ModificationOptions) IsSkipVerify ¶
func (m *ModificationOptions) IsSkipVerify() bool
type MultiBlobHandler ¶
type MultiBlobHandler []BlobHandler
MultiBlobHandler is a BlobHandler consisting of a sequence of handlers.
func (MultiBlobHandler) Len ¶
func (m MultiBlobHandler) Len() int
func (MultiBlobHandler) Less ¶
func (m MultiBlobHandler) Less(i, j int) bool
func (MultiBlobHandler) StoreBlob ¶
func (m MultiBlobHandler) StoreBlob(blob BlobAccess, artType, hint string, global AccessSpec, ctx StorageContext) (AccessSpec, error)
func (MultiBlobHandler) Swap ¶
func (m MultiBlobHandler) Swap(i, j int)
type PrioBlobHandler ¶
type PrioBlobHandler struct { BlobHandler Prio int }
type PriorityDecoder ¶
type PriorityDecoder[C any, T runtime.TypedObject] interface { Decode(ctx C, data []byte, unmarshaler runtime.Unmarshaler) (T, error) Priority() int }
type ReadOnlyFeature ¶
type ReadOnlyFeature interface { IsReadOnly() bool // SetReadOnly is used to set the element into readonly mode. // Once enabled it cannot be reverted. An underlying object, for // example a CTF might be in readonly mode, forced by filesystem // permissions. Such elements cannot be set into write mode again. // Therefore, generally only one direction is possible. SetReadOnly() }
type RegistrationHandlerInfo ¶
type RegistrationHandlerInfo = registrations.RegistrationHandlerInfo[Context, BlobHandlerOption]
func NewRegistrationHandlerInfo ¶
func NewRegistrationHandlerInfo(path string, handler BlobHandlerRegistrationHandler) *RegistrationHandlerInfo
type Repository ¶
type Repository interface { resource.ResourceView[Repository] RepositoryImpl NewComponentVersion(comp, version string, overrides ...bool) (ComponentVersionAccess, error) AddComponentVersion(cv ComponentVersionAccess, overrides ...bool) error }
type RepositoryCache ¶
type RepositoryCache struct {
// contains filtered or unexported fields
}
RepositoryCache is a utility object intended to be used by higher level objects such as session or resolver. Since the closing of the repository objects depends on the usage context (e.g. if components have been looked up in this repository, these components have to be closed before the repository can be closed), it is the responsibility of the higher level objects to close the repositories correctly.
func NewRepositoryCache ¶
func NewRepositoryCache() *RepositoryCache
func (*RepositoryCache) LookupRepository ¶
func (c *RepositoryCache) LookupRepository(ctx Context, spec RepositorySpec) (Repository, bool, error)
func (*RepositoryCache) Reset ¶
func (c *RepositoryCache) Reset()
type RepositoryDelegationRegistry ¶
type RepositoryDelegationRegistry = DelegationRegistry[Context, RepositorySpec]
RepositoryDelegationRegistry is used to register handlers able to dynamically enrich the set of available OCM repository types, which are supported without explicit registration at the OCM repository type registry. The definition of such types is *delegated* to the delegation handler. For example, it is used to fade in all the OCI repositories types provided by an OCI context and mapped by the genericocireg repository mapping. It is used as default decoder for the OCM repository type scheme. The encoding is done by the spec objects on their own behalf. Therefore, multi version spec types MUST correctly implement the MarshalJSOM method on the internal version.
type RepositoryImpl ¶
type RepositoryImpl interface { GetContext() Context GetSpecification() RepositorySpec ComponentLister() ComponentLister ExistsComponentVersion(name string, version string) (bool, error) LookupComponentVersion(name string, version string) (ComponentVersionAccess, error) LookupComponent(name string) (ComponentAccess, error) io.Closer ReadOnlyFeature }
type RepositorySpec ¶
type RepositorySpec interface { runtime.VersionedTypedObject // AsUniformSpec transforms the specification object // into a uniform repository spec as provided by // the string based parsing for repository/component/version // notations. The provided spec MUST be convertable again // into a repository spec with the same meaning // by registering an appropriate RepositorySpecHandler. AsUniformSpec(Context) *UniformRepositorySpec // Repository provides a repository implementation for the // repository specification. This repository can then be used // to access component versions in the technical OCM repository // described by the repository specification. Repository(Context, credentials.Credentials) (Repository, error) // Validate can be used to execute a type specific validation for // a repository specification. It should check the consistency of the // specified spec fields as well as the connectivity to the repository // as far as this is possible without a concrete component/version // in mind. Validate(Context, credentials.Credentials, ...credentials.UsageContext) error }
func CreateRepositorySpec ¶
func CreateRepositorySpec(t runtime.TypedObject) (RepositorySpec, error)
func NewGenericRepositorySpec ¶
func NewGenericRepositorySpec(data []byte, unmarshaler runtime.Unmarshaler) (RepositorySpec, error)
type RepositorySpecDecoder ¶
type RepositorySpecDecoder = runtime.TypedObjectDecoder[RepositorySpec]
type RepositorySpecHandler ¶
type RepositorySpecHandler interface {
MapReference(ctx Context, u *UniformRepositorySpec) (RepositorySpec, error)
}
type RepositorySpecHandlers ¶
type RepositorySpecHandlers interface { Register(hdlr RepositorySpecHandler, types ...string) Copy() RepositorySpecHandlers KnownTypeNames() []string GetHandlers(typ string) []RepositorySpecHandler MapUniformRepositorySpec(ctx Context, u *UniformRepositorySpec) (RepositorySpec, error) }
func NewRepositorySpecHandlers ¶
func NewRepositorySpecHandlers() RepositorySpecHandlers
type RepositoryType ¶
type RepositoryType interface { runtime.VersionedTypedObjectType[RepositorySpec] }
type RepositoryTypeProvider ¶
type RepositoryTypeProvider = runtime.KnownTypesProvider[RepositorySpec, RepositoryType]
type RepositoryTypeScheme ¶
type RepositoryTypeScheme interface { runtime.TypeScheme[RepositorySpec, RepositoryType] }
func NewRepositoryTypeScheme ¶
func NewRepositoryTypeScheme(defaultDecoder RepositorySpecDecoder, base ...RepositoryTypeScheme) RepositoryTypeScheme
func NewStrictRepositoryTypeScheme ¶
func NewStrictRepositoryTypeScheme(base ...RepositoryTypeScheme) RepositoryTypeScheme
type ResolvedComponentProvider ¶
type ResolvedComponentProvider interface { Repository() (Repository, error) LookupComponent(name string) (ResolvedComponentVersionProvider, error) }
ResolvedComponentProvider is an interface for an object providing optional access to a repository and a provider for component versions. Direct operations and operations of provided objects may fail, if an optional underlying object is already closed Therefore, it does not need to be explicitly closed.
Be careful: Objects of this plain type should only be held as long as the providing object is valid and not closed.
func RepositoryProviderForRepository ¶
func RepositoryProviderForRepository(r Repository) ResolvedComponentProvider
type ResolvedComponentVersionProvider ¶
type ResolvedComponentVersionProvider interface { GetName() string LookupVersion(version string) (ComponentVersionAccess, error) ListVersions() ([]string, error) }
ResolvedComponentVersionProvider is an interface for an object providing access component versions. Operations may fail, if an underlying object is already closed.
Be careful: Objects of this plain type should only be held as long as the providing object is valid and not closed.
type ResolverRule ¶
type ResolverRule interface { GetPrefix() string GetPath() registrations.NamePath GetSpecification() RepositorySpec GetPriority() int Match(name string) bool }
func NewResolverRule ¶
func NewResolverRule(prefix string, spec RepositorySpec, prio ...int) ResolverRule
type ResourceAccess ¶
type ResourceAccess = ArtifactAccess[ResourceMeta]
type ResourceMeta ¶
type ResourceMeta = compdesc.ResourceMeta
type SourceAccess ¶
type SourceAccess = ArtifactAccess[SourceMeta]
type SourceMeta ¶
type SourceMeta = compdesc.SourceMeta
type StorageContext ¶
type StorageContext interface { GetContext() Context TargetComponentName() string TargetComponentRepository() Repository GetImplementationRepositoryType() ImplementationRepositoryType }
StorageContext is an object describing the storage context used for the mapping of a component repository to a base repository (e.g. oci api) It depends on the Context type of the used base repository.
type TargetElement ¶
type TargetElement interface {
GetTargetIndex(resources compdesc.ElementListAccessor, meta accessors.ElementMeta) (int, error)
}
TargetElement described the index used to set the resource or source for the SetXXX calls. If -1 is returned an append is enforced.
type TargetElementOption ¶ added in v0.19.0
type TargetElementOption interface {
ApplyTargetOption(options *TargetElementOptions)
}
type TargetElementOptions ¶ added in v0.19.0
type TargetElementOptions struct {
TargetElement TargetElement
}
func NewTargetElementOptions ¶ added in v0.19.0
func NewTargetElementOptions(list ...TargetElementOption) *TargetElementOptions
func (*TargetElementOptions) ApplyBlobModificationOption ¶ added in v0.19.0
func (m *TargetElementOptions) ApplyBlobModificationOption(opts *BlobModificationOptions)
func (*TargetElementOptions) ApplyElementModificationOption ¶ added in v0.19.0
func (m *TargetElementOptions) ApplyElementModificationOption(opts *ElementModificationOptions)
func (*TargetElementOptions) ApplyModificationOption ¶ added in v0.19.0
func (m *TargetElementOptions) ApplyModificationOption(opts *ModificationOptions)
func (*TargetElementOptions) ApplyTargetOption ¶ added in v0.19.0
func (m *TargetElementOptions) ApplyTargetOption(opts *TargetElementOptions)
func (*TargetElementOptions) ApplyTargetOptions ¶ added in v0.19.0
func (m *TargetElementOptions) ApplyTargetOptions(list ...TargetElementOption) *TargetElementOptions
type TargetIdentity ¶
func (TargetIdentity) ApplyBlobModificationOption ¶
func (m TargetIdentity) ApplyBlobModificationOption(opts *BlobModificationOptions)
func (TargetIdentity) ApplyElementModificationOption ¶ added in v0.19.0
func (m TargetIdentity) ApplyElementModificationOption(opts *ElementModificationOptions)
func (TargetIdentity) ApplyModificationOption ¶
func (m TargetIdentity) ApplyModificationOption(opts *ModificationOptions)
func (TargetIdentity) ApplyTargetOption ¶
func (m TargetIdentity) ApplyTargetOption(opts *TargetElementOptions)
func (TargetIdentity) GetTargetIndex ¶
func (m TargetIdentity) GetTargetIndex(elems compdesc.ElementListAccessor, meta accessors.ElementMeta) (int, error)
type TargetIdentityOrAppend ¶
func (TargetIdentityOrAppend) ApplyBlobModificationOption ¶
func (m TargetIdentityOrAppend) ApplyBlobModificationOption(opts *BlobModificationOptions)
func (TargetIdentityOrAppend) ApplyElementModificationOption ¶ added in v0.19.0
func (m TargetIdentityOrAppend) ApplyElementModificationOption(opts *ElementModificationOptions)
func (TargetIdentityOrAppend) ApplyModificationOption ¶
func (m TargetIdentityOrAppend) ApplyModificationOption(opts *ModificationOptions)
func (TargetIdentityOrAppend) ApplyTargetOption ¶
func (m TargetIdentityOrAppend) ApplyTargetOption(opts *TargetElementOptions)
func (TargetIdentityOrAppend) GetTargetIndex ¶
func (m TargetIdentityOrAppend) GetTargetIndex(elems compdesc.ElementListAccessor, meta accessors.ElementMeta) (int, error)
type TargetIndex ¶
type TargetIndex int
func (TargetIndex) ApplyBlobModificationOption ¶
func (m TargetIndex) ApplyBlobModificationOption(opts *BlobModificationOptions)
func (TargetIndex) ApplyElementModificationOption ¶ added in v0.19.0
func (m TargetIndex) ApplyElementModificationOption(opts *ElementModificationOptions)
func (TargetIndex) ApplyModificationOption ¶
func (m TargetIndex) ApplyModificationOption(opts *ModificationOptions)
func (TargetIndex) ApplyTargetOption ¶
func (m TargetIndex) ApplyTargetOption(opts *TargetElementOptions)
func (TargetIndex) GetTargetIndex ¶
func (m TargetIndex) GetTargetIndex(elems compdesc.ElementListAccessor, meta accessors.ElementMeta) (int, error)
type TargetOptionImpl ¶
type TargetOptionImpl interface { TargetElementOption ModificationOption BlobModificationOption }
type UniformRepositorySpec ¶
type UniformRepositorySpec struct { // Type Type string `json:"type,omitempty"` // Scheme Scheme string `json:"scheme,omitempty"` // Host is the hostname of an ocm ref. Host string `json:"host,omitempty"` // SubPath is the sub path spec used to host component versions SubPath string `json:"subPath,omitempty"` // Info is the file path used to host ctf component versions Info string `json:"filePath,omitempty"` // CreateIfMissing indicates whether a file based or dynamic repo should be created if it does not exist CreateIfMissing bool `json:"createIfMissing,omitempty"` // TypeHint should be set if CreateIfMissing is true to help to decide what kind of repo to create TypeHint string `json:"typeHint,omitempty"` }
UniformRepositorySpec is generic specification of the repository for handling as part of standard references.
func UniformRepositorySpecForUnstructured ¶
func UniformRepositorySpecForUnstructured(un *runtime.UnstructuredVersionedTypedObject) *UniformRepositorySpec
func (*UniformRepositorySpec) CredHost ¶
func (r *UniformRepositorySpec) CredHost() string
CredHost fallback to legacy docker domain if applicable this is how containerd translates the old domain for DockerHub to the new one, taken from containerd/reference/docker/reference.go:674.
func (*UniformRepositorySpec) String ¶
func (u *UniformRepositorySpec) String() string
type UnknownAccessSpec ¶
type UnknownAccessSpec struct {
runtime.UnstructuredVersionedTypedObject `json:",inline"`
}
func (*UnknownAccessSpec) AccessMethod ¶
func (s *UnknownAccessSpec) AccessMethod(ComponentVersionAccess) (AccessMethod, error)
func (*UnknownAccessSpec) Describe ¶
func (s *UnknownAccessSpec) Describe(ctx Context) string
func (*UnknownAccessSpec) GlobalAccessSpec ¶
func (_ *UnknownAccessSpec) GlobalAccessSpec(Context) AccessSpec
func (*UnknownAccessSpec) IsLocal ¶
func (_ *UnknownAccessSpec) IsLocal(Context) bool
func (*UnknownAccessSpec) IsUnknown ¶
func (_ *UnknownAccessSpec) IsUnknown() bool
type UnknownRepositorySpec ¶
type UnknownRepositorySpec struct {
runtime.UnstructuredVersionedTypedObject `json:",inline"`
}
func (*UnknownRepositorySpec) AsUniformSpec ¶
func (r *UnknownRepositorySpec) AsUniformSpec(Context) *UniformRepositorySpec
func (*UnknownRepositorySpec) IsUnknown ¶
func (_ *UnknownRepositorySpec) IsUnknown() bool
func (*UnknownRepositorySpec) Repository ¶
func (r *UnknownRepositorySpec) Repository(Context, credentials.Credentials) (Repository, error)
func (*UnknownRepositorySpec) Validate ¶
func (r *UnknownRepositorySpec) Validate(ctx Context, creds credentials.Credentials, context ...credentials.UsageContext) error