examples/

directory
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: Apache-2.0

README

Scrinium examples

Runnable programs that show how to embed Scrinium in your own code. Each example is a self-contained main.go you can go run directly.

Examples

Example What it shows Lines
hello Smallest possible program: init a store, put one file, read it back, close. ~50
ingest Batch ingest: scan a directory tree and put every file into a store. Demonstrates Put with options, namespace, error handling. ~120
browse Read-only browser: open an existing store, iterate all artifacts, print summary stats. ~80

Running

Each example creates a temporary store under /tmp (override with --store=...).

# Smallest end-to-end: open → put → get → close.
go run ./examples/hello

# Ingest a directory tree.
go run ./examples/ingest --src=/path/to/files --store=/tmp/my-store

# Browse what's inside a store.
go run ./examples/browse --store=/tmp/my-store

What each example uses

All three import the top-level scrinium package — the high-level wrapper that bundles store, index, view, and FSOps. They also import the domain package for Artifact/PutOptions/GetOptions types.

The side-effect imports for driver/localfs and index/sqlite live inside scrinium already, so examples do not need to import them separately.

Directories

Path Synopsis
browse opens an existing Scrinium store read-only and prints a summary: total artifact count, total bytes referenced, per-namespace breakdown, and capacity from the underlying driver.
browse opens an existing Scrinium store read-only and prints a summary: total artifact count, total bytes referenced, per-namespace breakdown, and capacity from the underlying driver.
hello is the smallest Scrinium program: it creates (or opens) a store, puts one artifact, reads it back, and closes.
hello is the smallest Scrinium program: it creates (or opens) a store, puts one artifact, reads it back, and closes.
ingest scans a directory tree and stores every regular file as an artifact, with its relative path attached as fsmeta so the projection View renders it under by-path/.
ingest scans a directory tree and stores every regular file as an artifact, with its relative path attached as fsmeta so the projection View renders it under by-path/.

Jump to

Keyboard shortcuts

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