clip

package
v0.0.0-...-a2a14fb Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 37 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndUploadArchive

func CreateAndUploadArchive(ctx context.Context, options CreateOptions, si common.ClipStorageInfo) error

func CreateAndUploadOCIArchive

func CreateAndUploadOCIArchive(ctx context.Context, options CreateFromOCIImageOptions, si common.ClipStorageInfo) error

CreateAndUploadOCIArchive creates an OCI index and uploads metadata to S3 This combines indexing with remote storage upload

func CreateArchive

func CreateArchive(options CreateOptions) error

Create Archive

func CreateFromOCIImage

func CreateFromOCIImage(ctx context.Context, options CreateFromOCIImageOptions) error

CreateFromOCIImage creates a metadata-only index (.clip) file from an OCI image

func ExtractArchive

func ExtractArchive(options ExtractOptions) error

Extract Archive

func MountArchive

func MountArchive(options MountOptions) (func() error, <-chan error, *fuse.Server, error)

Mount a clip archive to a directory

func SetLogLevel

func SetLogLevel(level string) error

SetLogLevel configures the logging verbosity for the CLIP library. Valid levels: "debug", "info", "warn", "error", "disabled" Use "debug" to see detailed operation logs (file operations, cache hits/misses, etc.) Use "info" for high-level operation logs (default) Use "disabled" to suppress all logs

func StoreS3

func StoreS3(storeS3Opts StoreS3Options) error

Store CLIP in remote storage

Types

type ClipArchiver

type ClipArchiver struct {
}

func NewClipArchiver

func NewClipArchiver() *ClipArchiver

func (*ClipArchiver) Create

func (ca *ClipArchiver) Create(opts ClipArchiverOptions) error

func (*ClipArchiver) CreateFromOCI

func (ca *ClipArchiver) CreateFromOCI(ctx context.Context, opts IndexOCIImageOptions, clipOut string) error

CreateFromOCI creates a metadata-only .clip file from an OCI image

func (*ClipArchiver) CreateRemoteArchive

func (ca *ClipArchiver) CreateRemoteArchive(storageInfo common.ClipStorageInfo, metadata *common.ClipArchiveMetadata, outputFile string) error

func (*ClipArchiver) DecodeHeader

func (ca *ClipArchiver) DecodeHeader(headerBytes []byte) (*common.ClipArchiveHeader, error)

func (*ClipArchiver) EncodeHeader

func (ca *ClipArchiver) EncodeHeader(header *common.ClipArchiveHeader) ([]byte, error)

func (*ClipArchiver) EncodeIndex

func (ca *ClipArchiver) EncodeIndex(index *btree.BTree) ([]byte, error)

func (*ClipArchiver) Extract

func (ca *ClipArchiver) Extract(opts ClipArchiverOptions) error

func (*ClipArchiver) ExtractMetadata

func (ca *ClipArchiver) ExtractMetadata(archivePath string) (*common.ClipArchiveMetadata, error)

func (*ClipArchiver) IndexOCIImage

func (ca *ClipArchiver) IndexOCIImage(ctx context.Context, opts IndexOCIImageOptions) (
	index *btree.BTree,
	layerDigests []string,
	gzipIdx map[string]*common.GzipIndex,
	decompressedHashes map[string]string,
	registryURL string,
	repository string,
	reference string,
	imageMetadata *common.ImageMetadata,
	err error,
)

IndexOCIImage creates a metadata-only index from an OCI image

type ClipArchiverOptions

type ClipArchiverOptions struct {
	Compress    bool
	ArchivePath string
	SourcePath  string
	OutputFile  string
	OutputPath  string
}

type ClipFileSystem

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

func (*ClipFileSystem) CacheFile

func (cfs *ClipFileSystem) CacheFile(node *FSNode)

func (*ClipFileSystem) Root

func (cfs *ClipFileSystem) Root() (fs.InodeEmbedder, error)

type ClipFileSystemOpts

type ClipFileSystemOpts struct {
	Verbose               bool
	ContentCache          storage.ContentCache
	ContentCacheAvailable bool
}

type CreateFromOCIImageOptions

type CreateFromOCIImageOptions struct {
	ImageRef        string // Source image to index (can be local)
	StorageImageRef string // Optional: image reference to store in metadata (defaults to ImageRef)
	OutputPath      string
	CheckpointMiB   int64
	CredProvider    interface{}
	ProgressChan    chan<- OCIIndexProgress // optional channel for progress updates
	Platform        *v1.Platform            // Target platform (defaults to linux/runtime.GOARCH)
}

CreateFromOCIImageOptions configures OCI image indexing

type CreateOptions

type CreateOptions struct {
	InputPath    string
	OutputPath   string
	Credentials  storage.ClipStorageCredentials
	ProgressChan chan<- int
}

type CreateRemoteOptions

type CreateRemoteOptions struct {
	InputPath  string
	OutputPath string
}

type ExtractOptions

type ExtractOptions struct {
	InputFile  string
	OutputPath string
}

type FSNode

type FSNode struct {
	fs.Inode
	// contains filtered or unexported fields
}

func (*FSNode) Create

func (n *FSNode) Create(ctx context.Context, name string, flags uint32, mode uint32, out *fuse.EntryOut) (inode *fs.Inode, fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)

func (*FSNode) Getattr

func (n *FSNode) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*FSNode) Lookup

func (n *FSNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

func (*FSNode) Mkdir

func (n *FSNode) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

func (*FSNode) OnAdd

func (n *FSNode) OnAdd(ctx context.Context)

func (*FSNode) Open

func (n *FSNode) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)

func (*FSNode) Opendir

func (n *FSNode) Opendir(ctx context.Context) syscall.Errno

func (*FSNode) Read

func (n *FSNode) Read(ctx context.Context, f fs.FileHandle, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)

func (*FSNode) Readdir

func (n *FSNode) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)
func (n *FSNode) Readlink(ctx context.Context) ([]byte, syscall.Errno)

func (*FSNode) Rename

func (n *FSNode) Rename(ctx context.Context, oldName string, newParent fs.InodeEmbedder, newName string, flags uint32) syscall.Errno

func (*FSNode) Rmdir

func (n *FSNode) Rmdir(ctx context.Context, name string) syscall.Errno
func (n *FSNode) Unlink(ctx context.Context, name string) syscall.Errno

type IndexOCIImageOptions

type IndexOCIImageOptions struct {
	ImageRef        string                            // Source image to index (can be local)
	StorageImageRef string                            // Optional: image reference to store in metadata (defaults to ImageRef)
	CheckpointMiB   int64                             // Checkpoint every N MiB (default 2)
	CredProvider    common.RegistryCredentialProvider // optional credential provider for registry authentication
	ProgressChan    chan<- OCIIndexProgress           // optional channel for progress updates
	Platform        *v1.Platform                      // Target platform (defaults to linux/runtime.GOARCH)
}

IndexOCIImageOptions configures the OCI indexer

type InodeGenerator

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

InodeGenerator generates unique inodes for each ClipNode

func (*InodeGenerator) Next

func (ig *InodeGenerator) Next() uint64

type MountOptions

type MountOptions struct {
	ArchivePath           string
	MountPoint            string
	CachePath             string
	ContentCache          storage.ContentCache
	ContentCacheAvailable bool
	StorageInfo           common.ClipStorageInfo
	Credentials           storage.ClipStorageCredentials
	UseCheckpoints        bool        // Enable checkpoint-based partial decompression for OCI layers
	RegistryCredProvider  interface{} // Registry authentication (for OCI archives)
}

type OCIIndexProgress

type OCIIndexProgress struct {
	LayerIndex   int    // Current layer being processed (1-based)
	TotalLayers  int    // Total number of layers
	LayerDigest  string // Digest of current layer
	Stage        string // "starting" or "completed"
	FilesIndexed int    // Number of files indexed so far (only for "completed")
	Message      string // Human-readable message
}

OCIIndexProgress represents a progress update during OCI image indexing

type RClipArchiver

type RClipArchiver struct {
	ClipArchiver *ClipArchiver
	StorageInfo  common.ClipStorageInfo
}

func NewRClipArchiver

func NewRClipArchiver(si common.ClipStorageInfo) (*RClipArchiver, error)

func (*RClipArchiver) Create

func (rca *RClipArchiver) Create(ctx context.Context, archivePath string, outputPath string, credentials storage.ClipStorageCredentials, progressChan chan<- int) error

type StoreS3Options

type StoreS3Options struct {
	ArchivePath  string
	OutputFile   string
	Bucket       string
	Key          string
	CachePath    string
	Credentials  storage.ClipStorageCredentials
	ProgressChan chan<- int
}

Jump to

Keyboard shortcuts

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