paths

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package paths centralizes filesystem locations the daemon and clients agree on. Single source of truth so a change to (e.g.) the socket path only needs to be made here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackupsRoot

func BackupsRoot() string

BackupsRoot is the per-stack volume-backups root (Data()/backups/).

func Data

func Data() string

Data is $XDG_DATA_HOME/a-novel/ (default ~/.local/share/a-novel/). Volume backups live here.

func LogsRoot

func LogsRoot() string

LogsRoot is the per-stack logs root (State()/logs/).

func ReinstallCheckpoint

func ReinstallCheckpoint() string

ReinstallCheckpoint is the path of the one-shot reinstall handoff file. Single fixed location; presence == "new daemon should replay".

func SecretsRoot added in v1.0.4

func SecretsRoot() string

SecretsRoot is the local secrets store root (Data()/secrets/). It holds the AES-256-GCM local key and the encrypted store; both are created mode 0600 inside a 0700 directory by the secrets package. Honors $XDG_DATA_HOME (through Data()), which the secrets tests override to a temp dir.

func Socket

func Socket() string

Socket returns the absolute path of the daemon's unix domain socket.

Resolution priority (highest first):

  1. $XDG_RUNTIME_DIR/a-novel.sock — the canonical XDG location.
  2. /run/user/<uid>/a-novel.sock — the standard systemd-user runtime dir.
  3. /tmp/a-novel-<uid>.sock — the universal fallback.

The fallback chain is deterministic so the daemon and clients always agree without coordination through env vars or config files.

func State

func State() string

State is $XDG_STATE_HOME/a-novel/ (default ~/.local/state/a-novel/). Logs and the reinstall checkpoint live here.

Types

This section is empty.

Jump to

Keyboard shortcuts

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