paths

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package paths resolves otag's default file locations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheDir

func CacheDir(getenv Getenv, harness string) string

CacheDir returns the adapter cache directory of a harness: <data>/cache/<harness>.

func ConfigDir

func ConfigDir(getenv Getenv) string

ConfigDir returns the config directory: $OTAG_CONFIG_DIR or ~/.config/otag.

func DB

func DB(getenv Getenv) string

DB returns the database path: $OTAG_DB or ~/.local/share/otag/otag.db.

func DataDir

func DataDir(getenv Getenv) string

DataDir returns otag's data directory: $OTAG_DATA_DIR, else the directory of $OTAG_DB, else ~/.local/share/otag. Worktrees, per-run files and caches live here.

func ExpandHome

func ExpandHome(p string, getenv Getenv) string

ExpandHome replaces a leading "~" with the home directory.

func OtagBin

func OtagBin(getenv Getenv) string

OtagBin returns the absolute path of the otag binary that hooks and children should call: $OTAG_BIN or the running executable.

func RunDir

func RunDir(getenv Getenv, runID string) string

RunDir returns the private directory of a run: <data>/runs/<run>.

func TmuxConf

func TmuxConf(getenv Getenv) string

TmuxConf returns the config file for otag's tmux server: $OTAG_TMUX_CONF, else <config>/tmux.conf when it exists, else /dev/null (the user's ~/.tmux.conf is not loaded).

func TmuxSocket

func TmuxSocket(getenv Getenv) string

TmuxSocket returns the tmux socket name (tmux -L): $OTAG_TMUX_SOCKET or "otag".

func Within

func Within(dir, root string) bool

Within reports whether dir is root or inside it, with symlinks resolved (as far as the paths exist) and letter case ignored (APFS), so an alias cannot escape it.

func Worktree

func Worktree(getenv Getenv, project, taskID string) string

Worktree returns the worktree path of a task: <data>/worktrees/<project>/<task>.

func WorktreeRoot

func WorktreeRoot(getenv Getenv) string

WorktreeRoot returns the directory of every task worktree: <data>/worktrees. Only otag's task worktrees live there; no project may.

Types

type Getenv

type Getenv func(string) string

Getenv looks up an environment variable; injected so callers avoid global state.

Jump to

Keyboard shortcuts

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