engine

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitFile

type CommitFile struct {
	Name    string
	Content []byte
	Perm    string
}

CommitFile describes a single file in a Fossil check-in: name, content, and an optional executable-bit marker ("x" or "").

type Engine

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

Engine provides Fossil repository operations used by the VFS layer. Thin wrapper over libfossil's public API.

func Create

func Create(path string) (*Engine, error)

Create creates a new Fossil repository at path and returns an open Engine.

func Open

func Open(path string) (*Engine, error)

Open opens an existing Fossil repository.

func (*Engine) Checkin

func (e *Engine) Checkin(files []WriteFile, message string) error

Checkin creates a new commit with the given files and message. Preserved for the original FUSE-shape callers; new callers should use CommitFiles.

func (*Engine) Close

func (e *Engine) Close() error

Close closes the underlying repository.

func (*Engine) CommitFiles

func (e *Engine) CommitFiles(files []CommitFile, message, user string, parentRID int64, partialManifest bool) (int64, string, error)

CommitFiles creates a new check-in with the given files. When partialManifest is false, files tracked at parentRID but absent from files are carried forward automatically (Fossil's "fossil ci" semantics). When true, the new manifest contains only the provided files — used by the VFS overlay drain when the commit includes deletions.

func (*Engine) ListFiles

func (e *Engine) ListFiles(version string) ([]FileEntry, error)

ListFiles returns metadata for all files in the given version. Version can be "tip", "trunk", a UUID prefix, or empty (defaults to tip).

func (*Engine) ListFilesAt

func (e *Engine) ListFilesAt(rid int64) ([]FileEntry, error)

ListFilesAt returns file metadata for the given checkin RID.

func (*Engine) ReadFile

func (e *Engine) ReadFile(rid int64, path string) ([]byte, error)

ReadFile returns the content of a single file at the given checkin RID. Walks the delta chain internally; no disk checkout is required.

func (*Engine) Repo

func (e *Engine) Repo() *libfossil.Repo

Repo returns the underlying libfossil repo handle. Exposed for the VFS layer's overlay table (a SQLite table living inside the same agent repo file). Treat as an escape hatch — prefer the typed methods above.

func (*Engine) ResolveVersion

func (e *Engine) ResolveVersion(version string) (int64, error)

ResolveVersion resolves a symbolic version ("tip", "trunk", a branch name, a UUID, or a UUID prefix) to a numeric checkin RID.

func (*Engine) Stat

func (e *Engine) Stat(version string) (*RepoInfo, error)

Stat returns basic repository information for the given version.

type FileEntry

type FileEntry struct {
	Name string
	UUID string
	Perm string // "" or "x"
}

FileEntry is metadata for a single file in a checkin.

type RepoInfo

type RepoInfo struct {
	CheckinUUID string
	FileCount   int64
	Branch      string
}

RepoInfo holds basic repository statistics.

type WriteFile

type WriteFile struct {
	Path    string
	Content []byte
}

WriteFile holds a file to be checked in.

Jump to

Keyboard shortcuts

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