xdg

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Paths

type Paths struct {
	ConfigHome string
	DataHome   string
}

Paths holds XDG-compliant directory paths

func NewPaths

func NewPaths() (Paths, error)

NewPaths returns XDG-compliant directory paths If XDG environment variables are set, they are used; otherwise, defaults are applied

func (Paths) ConfigPath

func (p Paths) ConfigPath() string

ConfigPath returns the path to the config file

func (Paths) EnsureDirs

func (p Paths) EnsureDirs() error

EnsureDirs creates necessary directories with proper permissions (0700)

func (Paths) GetDefaultVaultPaths

func (p Paths) GetDefaultVaultPaths(isSUID bool) []string

GetDefaultVaultPaths generates default vault paths appropriate for the execution context When isSUID is false (normal execution): returns [cwd, home, system] vaults When isSUID is true (SUID execution): returns [system] vaults (home excluded for security)

The home path uses XDG_DATA_HOME if set, otherwise defaults to ~/.local/share/dotsecenv/vault

func (Paths) VaultPath

func (p Paths) VaultPath() string

VaultPath returns the path to the vault file

Jump to

Keyboard shortcuts

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