Documentation ¶
Overview ¶
Package support provides a standard implementation for the object type set required to implement the OCM repository interface.
This implementation is based on three interfaces that have to implemented:
- BlobContainer is used to provide access to blob data
- ComponentVersionContainer is used to provide access to component version for component.
The function NewComponentVersionAccessImpl can be used to create an object implementing the complete ComponentVersionAccess contract.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewComponentVersionAccessImpl ¶
func NewComponentVersionAccessImpl(name, version string, container ComponentVersionContainer, lazy bool, persistent bool) (cpi.ComponentVersionAccessImpl, error)
Types ¶
type AccessCheckError ¶
func (AccessCheckError) Error ¶
func (e AccessCheckError) Error() string
func (AccessCheckError) Unwrap ¶
func (e AccessCheckError) Unwrap() error
type BlobContainer ¶
type BlobContainer interface { GetBlobData(name string) (cpi.DataAccess, error) // GetStorageContext creates a storage context for blobs // that is used to feed blob handlers for specific blob storage methods. // If no handler accepts the blob, the AddBlobFor method will // be used to store the blob GetStorageContext(cv cpi.ComponentVersionAccess) cpi.StorageContext // AddBlobFor stores a local blob together with the component and // potentially provides a global reference according to the OCI distribution spec // if the blob described an oci artifact. // The resulting access information (global and local) is provided as // an access method specification usable in a component descriptor. // This is the direct technical storage, without caring about any handler. AddBlobFor(storagectx cpi.StorageContext, blob cpi.BlobAccess, refName string, global cpi.AccessSpec) (cpi.AccessSpec, error) }
BlobContainer is the interface for an element capable to store blobs.
type ComponentVersionAccessImpl ¶
type ComponentVersionAccessImpl interface { cpi.ComponentVersionAccessImpl EnablePersistence() Update(final bool) error }
type ComponentVersionContainer ¶
type ComponentVersionContainer interface { SetImplementation(impl ComponentVersionAccessImpl) GetParentViewManager() cpi.ComponentAccessViewManager GetContext() cpi.Context Repository() cpi.Repository IsReadOnly() bool Update() error GetDescriptor() *compdesc.ComponentDescriptor BlobContainer AccessMethod(a cpi.AccessSpec) (cpi.AccessMethod, error) GetInexpensiveContentVersionIdentity(a cpi.AccessSpec) string io.Closer }
ComponentVersionContainer is the interface of an element hosting a component version.
func GetComponentVersionContainer ¶
func GetComponentVersionContainer(cv cpi.ComponentVersionAccess) (ComponentVersionContainer, error)
type UpdateComponentVersionContainerError ¶
func (UpdateComponentVersionContainerError) Error ¶
func (e UpdateComponentVersionContainerError) Error() string
func (UpdateComponentVersionContainerError) Unwrap ¶
func (e UpdateComponentVersionContainerError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.