paths

package
v0.2.41 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package paths resolves platform-specific directories for configuration and data files.

Index

Constants

View Source
const (
	AppDirName       = "notify"
	ConfigFileName   = "notify-config.json"
	CooldownFileName = "cooldown.json"
	SilentFileName   = "silent.json"
	LogFileName      = "notify.log"
	DirPerm          = 0755 // rwxr-xr-x — owner full, group/other read+execute
	FilePerm         = 0644 // rw-r--r-- — owner read+write, group/other read-only
)

Variables

This section is empty.

Functions

func AtomicWrite added in v0.2.11

func AtomicWrite(path string, data []byte) error

AtomicWrite writes data to path via a temporary file + rename to avoid partial writes on crash. The parent directory is created if needed. Readers always see either the old or new contents, never a half-written file.

func CooldownKey

func CooldownKey(profile, action string) string

CooldownKey returns the map key for a profile/action pair.

func DataDir

func DataDir() string

DataDir returns the platform-specific data directory for notify:

  • Windows: %APPDATA%\notify
  • Unix: ~/.config/notify

Falls back to os.TempDir()/notify if neither is available.

Types

This section is empty.

Jump to

Keyboard shortcuts

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