vault

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package vault provides helpers for creating and inspecting vaults.

Index

Constants

This section is empty.

Variables

View Source
var SubDirs = []string{"notes", "journals", "templates", "assets"}

SubDirs are the content subdirectories that every fern vault must contain.

Functions

func Create

func Create(path string) error

Create sets up a new Fern Vault at the given path. Returns an error if the directory already exists.

func InitOrImport

func InitOrImport(path string) error

InitOrImport sets up the vault structure at path, creating directories and seed files as needed. Unlike Create, it succeeds if the directory already exists, making it safe for importing an existing vault.

func IsVault added in v1.2.0

func IsVault(path string) error

IsVault reports whether path is a valid fern vault directory.

func RequireFile

func RequireFile(dir, name, label string, cfg *config.Config) (string, error)

RequireFile resolves a file or returns a user-friendly error with the label.

func RequireNoFile

func RequireNoFile(dir, name, label string, cfg *config.Config) error

RequireNoFile ensures no file exists with this base name (any extension).

func ResolveFile

func ResolveFile(pathPrefix string, cfg *config.Config) (string, error)

ResolveFile finds an existing file by path prefix (without extension). Returns the full path or an error if not found.

func Stat

func Stat(cfg *config.Config) error

Stat prints vault statistics.

func VaultConfigPath added in v0.9.0

func VaultConfigPath(vaultPath string) string

VaultConfigPath returns the path to the vault-level config file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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