paths

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package paths provides centralized path resolution for Plural's data directories.

Plural supports the XDG Base Directory Specification for organizing files:

  • Config (XDG_CONFIG_HOME): config.json — user settings worth syncing
  • Data (XDG_DATA_HOME): sessions/*.json — local session history
  • State (XDG_STATE_HOME): logs/ — transient log files

Resolution order:

  1. If ~/.plural/ exists → use legacy flat layout (all paths under ~/.plural/)
  2. If XDG env vars are set → use XDG layout with proper separation
  3. Fresh install, no XDG vars → default to ~/.plural/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns the directory for configuration files (config.json).

func ConfigFilePath

func ConfigFilePath() (string, error)

ConfigFilePath returns the full path to config.json.

func DataDir

func DataDir() (string, error)

DataDir returns the directory for persistent data files.

func IsLegacyLayout

func IsLegacyLayout() bool

IsLegacyLayout returns true if using the ~/.plural/ flat layout.

func LogsDir

func LogsDir() (string, error)

LogsDir returns the directory for log files.

func Reset

func Reset()

Reset clears the cached path resolution. This is intended for testing only.

func SessionsDir

func SessionsDir() (string, error)

SessionsDir returns the directory for session message files.

func StateDir

func StateDir() (string, error)

StateDir returns the directory for runtime state and logs.

func WorktreesDir

func WorktreesDir() (string, error)

WorktreesDir returns the directory for centralized git worktrees.

Types

This section is empty.

Jump to

Keyboard shortcuts

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