mount

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package mount loads database manifests and opens the corresponding DALgo drivers, producing ready-to-serve core.Database instances. Storage access inside ovdb is dalgo-native: each engine is simply a dal.DB driver plus a schema-mode capability declaration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir(dir string) (map[string]*core.Database, error)

Dir mounts every *.yaml / *.yml manifest found directly in dir, keyed by database id. It fails on the first manifest that does not mount; see DirReport for a scan that tolerates broken manifests.

func DirReport added in v0.6.0

func DirReport(dir string) (map[string]*core.Database, map[string]error, error)

DirReport mounts every *.yaml / *.yml manifest found directly in dir, like Dir, but one manifest that fails to mount does not stop the others. It returns the mounted databases keyed by database id and the failures keyed by manifest path. The error result is non-nil only when dir itself cannot be read.

func DirReportWithOptions added in v0.6.0

func DirReportWithOptions(dir string, opts Options) (map[string]*core.Database, map[string]error, error)

DirReportWithOptions is DirReport mounting each manifest with FileWithOptions, e.g. so a registry scan never writes into user storage. Catalogues in Options.CatalogueDir are per database id and cannot collide (duplicate ids are rejected).

func File

func File(manifestPath string) (*core.Database, error)

File mounts one database from a manifest file. Relative storage paths are resolved against the manifest file's directory.

func FileWithOptions added in v0.6.0

func FileWithOptions(manifestPath string, opts Options) (*core.Database, error)

FileWithOptions is File with mount Options. With CatalogueDir set outside the storage and SkipGitIdentity true, mounting an existing local inGitDB folder or SQLite file adds or changes nothing in it (writes made later through the database still land in the storage, as they must).

Types

type Options added in v0.6.0

type Options struct {
	// CatalogueDir, when set, is where the inferred-schema catalogue lives,
	// as <CatalogueDir>/<database id>.inferred.json, for every engine —
	// instead of the default next to (or inside) the user's storage
	// (<file>.inferred.json, <folder>/.ovdb/inferred-schema.json).
	CatalogueDir string
	// SkipGitIdentity disables stamping a repo-local git identity on a local
	// inGitDB folder (see ensureGitIdentity), so mounting leaves .git/config
	// untouched. Commits then rely on the host's own git identity.
	SkipGitIdentity bool
}

Options tunes how FileWithOptions mounts a database. The zero value is the behaviour of File.

Jump to

Keyboard shortcuts

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