Help us shape the future of Go! Take the 2026 Go Developer Survey

materialize

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONMaterializer added in v0.6.8

type JSONMaterializer struct{}

JSONMaterializer reads the node tree from a mache SQLite DB and writes it as a hierarchical JSON file. Directories become nested objects with a "children" array; files become leaf objects with "content" and "size".

Uses parent_id + name traversal (same as BoltDB materializer) so node names containing slashes or special characters are handled correctly.

Output is written atomically: data goes to a temp file first, then os.Rename replaces the target path.

func (*JSONMaterializer) Materialize added in v0.6.8

func (m *JSONMaterializer) Materialize(srcDB, outPath string) error

type Materializer

type Materializer interface {
	Materialize(srcDB, outPath string) error
}

Materializer writes a projected node tree (from a mache SQLite DB) to an output format.

func ForFormat

func ForFormat(format string) (Materializer, error)

ForFormat returns the appropriate Materializer for the given format string.

type SQLiteMaterializer

type SQLiteMaterializer struct{}

SQLiteMaterializer copies the source DB as-is to the output path.

func (*SQLiteMaterializer) Materialize

func (m *SQLiteMaterializer) Materialize(srcDB, outPath string) error

type ZIPMaterializer

type ZIPMaterializer struct{}

ZIPMaterializer reads the node tree from a mache SQLite DB and writes all file nodes (kind=0) with non-NULL content as entries in a ZIP archive. Directory nodes are implicit (paths contain slashes).

func (*ZIPMaterializer) Materialize

func (m *ZIPMaterializer) Materialize(srcDB, outPath string) error

Jump to

Keyboard shortcuts

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