ctf

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

README

Repository CommonTransportFormat - Filesystem-based Storage of OCI repositories

Synopsis
type: CommonTransportFormat/v1
Description

Artifact namespaces/repositories of the API layer will be mapped to a filesystem-based representation according to the Common Transport Format specification.

Supported specification version is v1.

Specification Versions
Version v1

The type specific specification fields are:

  • filePath string

    The path in the filesystem used to store the content

  • fileFormat string

    The file format to use:

    • directory: stored as file hierarchy in a directory
    • tar: stored as file hierarchy in a TAR file
    • tgz: stored as file hierarchy in a GNU-zipped TAR file (tgz)
  • accessMode (optional) byte

    Access mode used to access the content:

    • 0: write access
    • 1: read-only
    • 2: create id not existent, yet
Go Bindings

The Go binding can be found here

Documentation

Index

Constants

View Source
const (
	ArtifactIndexFileName = format.ArtifactIndexFileName
	BlobsDirectoryName    = format.BlobsDirectoryName
)
View Source
const (
	Type   = cpi.CommonTransportFormat
	TypeV1 = Type + runtime.VersionSeparator + "v1"
)

Variables

Functions

func GetFormats

func GetFormats() []string

func NewNamespace

func NewNamespace(repo *RepositoryImpl, name string) (cpi.NamespaceAccess, error)

func NewStateHandler

func NewStateHandler(fs vfs.FileSystem) accessobj.StateHandler

func SupportedFormats

func SupportedFormats() []accessio.FileFormat

Types

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

func RegisterFormat

func RegisterFormat(f accessobj.FormatHandler) FormatHandler

type Object

type Object = Repository

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)

func OpenFromBlob

func OpenFromBlob(ctx cpi.ContextProvider, acc accessobj.AccessMode, blob accessio.BlobAccess, opts ...accessio.Option) (*Object, error)

type Repository

type Repository struct {
	cpi.Repository
	// contains filtered or unexported fields
}

func New

func New(ctx cpi.Context, spec *RepositorySpec, setup accessobj.Setup, closer accessobj.Closer, mode vfs.FileMode) (*Repository, error)

New returns a new representation based repository.

func (*Repository) Close

func (r *Repository) Close() error

func (*Repository) Write

func (r *Repository) Write(path string, mode vfs.FileMode, opts ...accessio.Option) error

type RepositoryImpl

type RepositoryImpl struct {
	cpi.RepositoryImplBase
	// contains filtered or unexported fields
}

RepositoryImpl is closed, if all views are released.

func (*RepositoryImpl) Close

func (r *RepositoryImpl) Close() error

func (*RepositoryImpl) ExistsArtifact

func (r *RepositoryImpl) ExistsArtifact(name string, tag string) (bool, error)

func (*RepositoryImpl) GetNamespaces

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

func (*RepositoryImpl) GetSpecification

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

func (*RepositoryImpl) IsReadOnly

func (r *RepositoryImpl) IsReadOnly() bool

func (*RepositoryImpl) LookupArtifact

func (r *RepositoryImpl) LookupArtifact(name string, ref string) (acc cpi.ArtifactAccess, err error)

func (*RepositoryImpl) LookupNamespace

func (r *RepositoryImpl) LookupNamespace(name string) (cpi.NamespaceAccess, error)

func (*RepositoryImpl) NamespaceLister

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

func (*RepositoryImpl) NumNamespaces

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

func (*RepositoryImpl) Update

func (r *RepositoryImpl) Update() error

func (*RepositoryImpl) Write

func (r *RepositoryImpl) Write(path string, mode vfs.FileMode, opts ...accessio.Option) error

type RepositorySpec

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

	// 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"`
}

RepositorySpec describes an OCI registry interface backed by an oci registry.

func NewRepositorySpec

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

NewRepositorySpec creates a new RepositorySpec.

func (*RepositorySpec) GetType

func (a *RepositorySpec) GetType() string

func (*RepositorySpec) IsIntermediate

func (a *RepositorySpec) IsIntermediate() bool

func (*RepositorySpec) Name

func (s *RepositorySpec) Name() string

func (*RepositorySpec) Repository

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

func (*RepositorySpec) UniformRepositorySpec

func (s *RepositorySpec) UniformRepositorySpec() *cpi.UniformRepositorySpec

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{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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