comparch

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: 26 Imported by: 0

README

Repository ComponentArchive - Filesystem based Storage of a Component Version

Synopsis
type: ComponentArchive/v1
Description

The content of a single OCM Component Version will be stored as Filesystem content. This is a special version of an OCM Repository, which can be used to compose a component version during the build time of a component.

Supported specification version is v1.

Specification Versions
Version v1

The type specific specification fields are:

  • filePath string

    Path in filesystem used to host the repository.

  • fileFormat (optional) string

    The format to use to store content:

    • directory: stored as directory structure
    • tar: stored as directory structure in a tar file
    • tgz: stored as directory structure in a tar file compressed by GNU Zip
Go Bindings

The Go binding can be found here.

Documentation

Index

Constants

View Source
const (
	Type   = "ComponentArchive"
	TypeV1 = Type + runtime.VersionSeparator + "v1"
)
View Source
const AltType = "ca"
View Source
const BlobsDirectoryName = "blobs"

BlobsDirectoryName is the name of the blob directory in the tar.

View Source
const ComponentDescriptorFileName = compdesc.ComponentDescriptorFileName

ComponentDescriptorFileName is the name of the component-descriptor file.

Variables

Functions

func GetFormats

func GetFormats() []string

func NewRepository

func NewRepository(ctxp cpi.ContextProvider, s *RepositorySpec) (cpi.Repository, error)

func NewStateHandler

func NewStateHandler(fs vfs.FileSystem) accessobj.StateHandler

func RegisterFormat

func RegisterFormat(f accessobj.FormatHandler) *formatHandler

Types

type BlobSink

type BlobSink struct {
	Sink ocicpi.BlobSink
}

func (*BlobSink) AddBlob

func (s *BlobSink) AddBlob(blob blobaccess.BlobAccess) (string, error)

type ComponentAccessImpl

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

func (*ComponentAccessImpl) Close

func (c *ComponentAccessImpl) Close() error

func (*ComponentAccessImpl) GetContext

func (c *ComponentAccessImpl) GetContext() cpi.Context

func (*ComponentAccessImpl) GetName

func (c *ComponentAccessImpl) GetName() string

func (*ComponentAccessImpl) GetParentBridge

func (c *ComponentAccessImpl) GetParentBridge() repocpi.RepositoryViewManager

func (*ComponentAccessImpl) HasVersion

func (c *ComponentAccessImpl) HasVersion(vers string) (bool, error)

func (*ComponentAccessImpl) IsReadOnly

func (c *ComponentAccessImpl) IsReadOnly() bool

func (*ComponentAccessImpl) ListVersions

func (c *ComponentAccessImpl) ListVersions() ([]string, error)

func (*ComponentAccessImpl) LookupVersion

func (c *ComponentAccessImpl) LookupVersion(version string) (*repocpi.ComponentVersionAccessInfo, error)

func (*ComponentAccessImpl) NewVersion

func (c *ComponentAccessImpl) NewVersion(version string, overrides ...bool) (*repocpi.ComponentVersionAccessInfo, error)

func (*ComponentAccessImpl) SetBridge

type ComponentArchive

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

ComponentArchive is the go representation for a component artifact.

func New

New returns a new representation based element.

func (*ComponentArchive) AsRepository

func (c *ComponentArchive) AsRepository() cpi.Repository

AsRepository returns a repository view closing the archive.

func (*ComponentArchive) Close

func (c *ComponentArchive) Close() error

func (*ComponentArchive) IsReadOnly

func (c *ComponentArchive) IsReadOnly() bool

func (*ComponentArchive) Repository

func (c *ComponentArchive) Repository() cpi.Repository

Repository returns a non referencing repository which does not close the archive.

func (*ComponentArchive) SetName

func (c *ComponentArchive) SetName(n string)

func (*ComponentArchive) SetReadOnly

func (c *ComponentArchive) SetReadOnly()

func (*ComponentArchive) SetVersion

func (c *ComponentArchive) SetVersion(v string)

type ComponentVersionContainer

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

func (*ComponentVersionContainer) AccessMethod

func (*ComponentVersionContainer) AddBlob

func (c *ComponentVersionContainer) AddBlob(blob cpi.BlobAccess, refName string, global cpi.AccessSpec) (cpi.AccessSpec, error)

func (*ComponentVersionContainer) Close

func (c *ComponentVersionContainer) Close() error

func (*ComponentVersionContainer) GetBlob

func (c *ComponentVersionContainer) GetBlob(name string) (cpi.DataAccess, error)

func (*ComponentVersionContainer) GetContext

func (c *ComponentVersionContainer) GetContext() cpi.Context

func (*ComponentVersionContainer) GetDescriptor

func (*ComponentVersionContainer) GetInexpensiveContentVersionIdentity

func (c *ComponentVersionContainer) GetInexpensiveContentVersionIdentity(a cpi.AccessSpec, cv refmgmt.ExtendedAllocatable) string

func (*ComponentVersionContainer) GetParentBridge

func (*ComponentVersionContainer) GetStorageContext

func (c *ComponentVersionContainer) GetStorageContext() cpi.StorageContext

func (*ComponentVersionContainer) IsReadOnly

func (c *ComponentVersionContainer) IsReadOnly() bool

func (*ComponentVersionContainer) Repository

func (c *ComponentVersionContainer) Repository() cpi.Repository

func (*ComponentVersionContainer) SetBridge

func (*ComponentVersionContainer) SetDescriptor

func (*ComponentVersionContainer) SetReadOnly

func (c *ComponentVersionContainer) SetReadOnly()

func (*ComponentVersionContainer) Update

func (c *ComponentVersionContainer) Update() error

type FormatHandler

type FormatHandler interface {
	accessio.Option

	Format() accessio.FileFormat

	Open(ctx cpi.ContextProvider, acc accessobj.AccessMode, path string, opts accessio.Options) (*Object, error)
	Create(ctx cpi.ContextProvider, path string, opts accessio.Options, mode vfs.FileMode) (*Object, error)
	Write(obj *Object, path string, opts accessio.Options, mode vfs.FileMode) error
}

func GetFormat

func GetFormat(name accessio.FileFormat) FormatHandler

type Object

type Object = ComponentArchive

func Create

func Create(ctx cpi.ContextProvider, acc accessobj.AccessMode, path string, mode vfs.FileMode, opts ...accessio.Option) (*Object, error)

func Open

func Open(ctx cpi.ContextProvider, acc accessobj.AccessMode, path string, mode vfs.FileMode, opts ...accessio.Option) (*Object, error)

type RepositoryImpl

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

func (*RepositoryImpl) Close

func (r *RepositoryImpl) Close() error

func (*RepositoryImpl) ComponentLister

func (r *RepositoryImpl) ComponentLister() cpi.ComponentLister

func (*RepositoryImpl) ExistsComponentVersion

func (r *RepositoryImpl) ExistsComponentVersion(name string, ref string) (bool, error)

func (*RepositoryImpl) Get

func (r *RepositoryImpl) Get() *ComponentArchive

func (*RepositoryImpl) GetComponents

func (r *RepositoryImpl) GetComponents(prefix string, closure bool) ([]string, error)

func (*RepositoryImpl) GetContext

func (r *RepositoryImpl) GetContext() cpi.Context

func (*RepositoryImpl) GetSpecification

func (r *RepositoryImpl) GetSpecification() cpi.RepositorySpec

func (*RepositoryImpl) IsReadOnly

func (r *RepositoryImpl) IsReadOnly() bool

func (*RepositoryImpl) LookupComponent

func (r *RepositoryImpl) LookupComponent(name string) (*repocpi.ComponentAccessInfo, error)

func (*RepositoryImpl) NumComponents

func (r *RepositoryImpl) NumComponents(prefix string) (int, error)

func (*RepositoryImpl) SetBridge

func (r *RepositoryImpl) SetBridge(base repocpi.RepositoryBridge)

func (*RepositoryImpl) SetReadOnly

func (r *RepositoryImpl) SetReadOnly()

type RepositorySpec

type RepositorySpec struct {
	runtime.ObjectVersionedType `json:",inline"`
	accessio.StandardOptions    `json:",omitempty"`

	// FileFormat is the format of the repository file
	FilePath string `json:"filePath"`
	// AccessMode can be set to request readonly access or creation
	AccessMode accessobj.AccessMode `json:"accessMode,omitempty"`
}

func NewRepositorySpec

func NewRepositorySpec(acc accessobj.AccessMode, filePath string, opts ...accessio.Option) (*RepositorySpec, error)

NewRepositorySpec creates a new RepositorySpec.

func (*RepositorySpec) AsUniformSpec

func (a *RepositorySpec) AsUniformSpec(cpi.Context) *cpi.UniformRepositorySpec

func (*RepositorySpec) GetType

func (a *RepositorySpec) GetType() string

func (*RepositorySpec) IsIntermediate

func (a *RepositorySpec) IsIntermediate() bool

func (*RepositorySpec) Repository

func (a *RepositorySpec) Repository(ctx cpi.Context, creds credentials.Credentials) (cpi.Repository, error)

type StateHandler

type StateHandler struct{}

func (StateHandler) Decode

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

func (StateHandler) Encode

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

func (StateHandler) Equivalent

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

func (StateHandler) Initial

func (i StateHandler) Initial() interface{}

Jump to

Keyboard shortcuts

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