example

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package example contains a simple implementation providing a virtual OCM repository based on some opinionated filesystem structure. It uses the virtual package by providing a dedicated implementation of the virtual.Access interface working on a virtual filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRepository

func NewRepository(ctx cpi.ContextProvider, fs vfs.FileSystem, readonly bool, path ...string) (cpi.Repository, error)

Types

type Access

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

func NewAccess

func NewAccess(fs vfs.FileSystem, readonly bool) (*Access, error)

func (*Access) Close

func (a *Access) Close() error

func (*Access) ComponentLister

func (a *Access) ComponentLister() cpi.ComponentLister

func (*Access) ExistsComponentVersion

func (a *Access) ExistsComponentVersion(name string, version string) (bool, error)

func (*Access) GetComponentVersion

func (a *Access) GetComponentVersion(comp, version string) (virtual.VersionAccess, error)

func (*Access) IsReadOnly

func (a *Access) IsReadOnly() bool

func (*Access) ListVersions

func (a *Access) ListVersions(comp string) ([]string, error)

func (*Access) Reset

func (a *Access) Reset() error

func (*Access) SetReadOnly

func (a *Access) SetReadOnly()

type Index

type Index = virtual.Index[string]

type VersionAccess

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

func (*VersionAccess) AddBlob

func (v *VersionAccess) AddBlob(blob cpi.BlobAccess) (string, error)

func (*VersionAccess) Close

func (v *VersionAccess) Close() error

func (*VersionAccess) GetBlob

func (v *VersionAccess) GetBlob(name string) (cpi.DataAccess, error)

func (*VersionAccess) GetDescriptor

func (v *VersionAccess) GetDescriptor() *compdesc.ComponentDescriptor

func (*VersionAccess) IsReadOnly

func (v *VersionAccess) IsReadOnly() bool

func (*VersionAccess) SetReadOnly

func (v *VersionAccess) SetReadOnly()

func (*VersionAccess) Update

func (v *VersionAccess) Update() error

Jump to

Keyboard shortcuts

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