comparch

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 24 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 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(ctx cpi.Context, 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 added in v0.3.0

type BlobSink struct {
	Sink ocicpi.BlobSink
}

func (*BlobSink) AddBlob added in v0.3.0

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

type ComponentAccessImpl added in v0.3.0

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

func (*ComponentAccessImpl) Close added in v0.5.0

func (c *ComponentAccessImpl) Close() error

func (*ComponentAccessImpl) GetContext added in v0.5.0

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

func (*ComponentAccessImpl) GetName added in v0.5.0

func (c *ComponentAccessImpl) GetName() string

func (*ComponentAccessImpl) GetParentBridge added in v0.5.0

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

func (*ComponentAccessImpl) HasVersion added in v0.3.0

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

func (*ComponentAccessImpl) IsReadOnly added in v0.4.1

func (c *ComponentAccessImpl) IsReadOnly() bool

func (*ComponentAccessImpl) ListVersions added in v0.3.0

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

func (*ComponentAccessImpl) LookupVersion added in v0.3.0

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

func (*ComponentAccessImpl) NewVersion added in v0.3.0

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

func (*ComponentAccessImpl) SetBridge added in v0.5.0

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 added in v0.4.1

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) SetVersion

func (c *ComponentArchive) SetVersion(v string)

type ComponentVersionContainer added in v0.5.0

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

func (*ComponentVersionContainer) AccessMethod added in v0.5.0

func (*ComponentVersionContainer) AddBlob added in v0.5.0

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

func (*ComponentVersionContainer) Close added in v0.5.0

func (c *ComponentVersionContainer) Close() error

func (*ComponentVersionContainer) GetBlob added in v0.5.0

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

func (*ComponentVersionContainer) GetContext added in v0.5.0

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

func (*ComponentVersionContainer) GetDescriptor added in v0.5.0

func (*ComponentVersionContainer) GetInexpensiveContentVersionIdentity added in v0.5.0

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

func (*ComponentVersionContainer) GetParentBridge added in v0.5.0

func (*ComponentVersionContainer) GetStorageContext added in v0.5.0

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

func (*ComponentVersionContainer) IsReadOnly added in v0.5.0

func (c *ComponentVersionContainer) IsReadOnly() bool

func (*ComponentVersionContainer) Repository added in v0.5.0

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

func (*ComponentVersionContainer) SetBridge added in v0.5.0

func (*ComponentVersionContainer) SetDescriptor added in v0.5.0

func (*ComponentVersionContainer) Update added in v0.5.0

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 added in v0.3.0

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

func (*RepositoryImpl) Close added in v0.5.0

func (r *RepositoryImpl) Close() error

func (*RepositoryImpl) ComponentLister added in v0.3.0

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

func (*RepositoryImpl) ExistsComponentVersion added in v0.3.0

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

func (*RepositoryImpl) Get added in v0.3.0

func (r *RepositoryImpl) Get() *ComponentArchive

func (*RepositoryImpl) GetComponents added in v0.3.0

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

func (*RepositoryImpl) GetContext added in v0.5.0

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

func (*RepositoryImpl) GetSpecification added in v0.3.0

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

func (*RepositoryImpl) LookupComponent added in v0.3.0

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

func (*RepositoryImpl) NumComponents added in v0.3.0

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

func (*RepositoryImpl) SetBridge added in v0.5.0

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

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