Documentation
¶
Index ¶
- func DaysUntil(t time.Time) int
- func EnsureDir(path string) error
- func ExpandHome(path string) string
- func FileExists(path string) bool
- func GoalsPath() string
- func NotesPath(repo string) string
- func ReadFile(path string) (string, error)
- func SanitizeRepoName(name string) (string, error)
- func WorkspaceBaseDir() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DaysUntil ¶
DaysUntil returns the number of days until t, rounded half away from zero so a deadline a few hours from now reads 0, one a day out reads 1, and a deadline that passed reads negative — past and future are never conflated by naive truncation.
func ExpandHome ¶
ExpandHome expands a leading "~" to the user's home directory. It only treats "~" as home when it is the first character and is followed by a path separator or is the whole string, so paths like "~/a" expand but a literal "~" inside a path (e.g. "x~y") is left untouched.
func FileExists ¶
func SanitizeRepoName ¶
SanitizeRepoName validates that a name is safe to use as a single filename segment for note storage. It rejects empty names, names containing path separators, or ".." segments, which would otherwise let a caller escape the notes directory via path traversal (e.g. "../../.bashrc").
func WorkspaceBaseDir ¶
func WorkspaceBaseDir() string
WorkspaceBaseDir resolves the DevPulse data root, honouring DEVPULSE_CONFIG so notes/goals/cache/logs follow the config location.
Types ¶
This section is empty.