store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package store handles persistence of snippets to a JSON file under the user's config directory (~/.config/snip/snippets.json).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns ~/.config/snip, creating nothing.

func ConfigFile

func ConfigFile() string

ConfigFile returns the path to the viper settings file (~/.config/snip/.snip).

func Load

func Load() (*snippet.Store, error)

Load reads the snippet store from disk. A missing file yields an empty store (not an error), so the tool works before anything is saved.

func Save

func Save(s *snippet.Store) error

Save writes the store to disk atomically (temp file + rename) with 0600 perms.

Types

This section is empty.

Jump to

Keyboard shortcuts

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