support

package
v2.0.0-...-98cc131 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

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

type AccessCheckError struct {
	Name    string
	Version string
	Type    string

	Original error
}

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.

type UpdateComponentVersionContainerError

type UpdateComponentVersionContainerError struct {
	Name    string
	Version string

	Original error
}

func (UpdateComponentVersionContainerError) Error

func (UpdateComponentVersionContainerError) Unwrap

Jump to

Keyboard shortcuts

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