snapshot

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir() string

Dir returns the snapshot storage directory (~/.local/share/pkgtrack/snapshots/).

func EnsureDir

func EnsureDir() error

EnsureDir creates the snapshot directory if it doesn't exist.

func FormatDiff

func FormatDiff(d model.Diff) string

FormatDiff returns a human-readable diff summary.

func Latest

func Latest() (*model.Snapshot, error)

Latest returns the most recent snapshot, or nil if none exist.

func List

func List() ([]string, error)

List returns all snapshot file paths, newest first.

func Load

func Load(path string) (*model.Snapshot, error)

Load reads a snapshot from a file.

func LoadNotes

func LoadNotes() map[string]string

LoadNotes reads user-defined descriptions from disk. Returns an empty map if the file doesn't exist.

func New

func New(pkgs []model.Package) *model.Snapshot

New creates a snapshot from a list of packages.

func Save

func Save(snap *model.Snapshot) (string, error)

Save writes a snapshot to disk.

func SaveNotes

func SaveNotes(notes map[string]string) error

SaveNotes writes user-defined descriptions to disk.

Types

This section is empty.

Jump to

Keyboard shortcuts

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