Documentation
¶
Overview ¶
Package vault provides helpers for creating and inspecting vaults.
Index ¶
- Variables
- func Create(path string) error
- func InitOrImport(path string) error
- func IsVault(path string) error
- func RequireFile(dir, name, label string, cfg *config.Config) (string, error)
- func RequireNoFile(dir, name, label string, cfg *config.Config) error
- func ResolveFile(pathPrefix string, cfg *config.Config) (string, error)
- func Stat(cfg *config.Config) error
- func VaultConfigPath(vaultPath string) string
Constants ¶
This section is empty.
Variables ¶
var SubDirs = []string{"notes", "journals", "templates", "assets"}
SubDirs are the content subdirectories that every fern vault must contain.
Functions ¶
func Create ¶
Create sets up a new Fern Vault at the given path. Returns an error if the directory already exists.
func InitOrImport ¶
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 RequireFile ¶
RequireFile resolves a file or returns a user-friendly error with the label.
func RequireNoFile ¶
RequireNoFile ensures no file exists with this base name (any extension).
func ResolveFile ¶
ResolveFile finds an existing file by path prefix (without extension). Returns the full path or an error if not found.
func VaultConfigPath ¶ added in v0.9.0
VaultConfigPath returns the path to the vault-level config file.
Types ¶
This section is empty.