Versions in this module Expand all Collapse all v0 v0.1.1 Nov 13, 2026 v0.1.0 Nov 13, 2026 Changes in this version + var ErrBadHomeFile = errors.New("home file cannot be read") + var ErrBusy = errors.New("busy") + var ErrEnvVar = errors.New("variable not set") + var ErrGitignoreMarkers = errors.New("gitignore markers are broken") + var ErrInvalidOption = errors.New("invalid option") + var ErrLayoutTooNew = errors.New("home layout is newer than this binary") + var ErrNoHome = errors.New("no home folder") + var ErrNoProject = errors.New("no project home") + var ErrNotHome = errors.New("folder belongs to another app") + var ErrPointerAbsolute = errors.New("absolute pointer in a committed file") + var ErrPointerMissing = errors.New("pointer target does not exist") + var ErrPointerNotHome = errors.New("pointer target is not a home of this app") + var ErrProdDB = errors.New("dev build refuses the prod database") + var ErrRootOwned = errors.New("running as root in another user's home") + var ErrSymlinkEscape = errors.New("symlink leads outside the home") + var ErrUnknownKind = errors.New("unknown kind") + var ErrUnknownProfile = errors.New("unknown profile") + var ErrUnsafeTemp = errors.New("unsafe temp folder") + func CleanEnv(environ []string, prefix string) []string + func ForTest(t testing.TB, app string) string + type ConfigFile struct + Committed bool + Home Scope + Local bool + Path string + Profile Profile + type ConfigReader func(path string) (map[string]any, error) + type DBAccess int + const AccessReadOnly + const AccessReadWrite + func (a DBAccess) String() string + type Dirs struct + func New(app string, opts ...Option) (*Dirs, error) + func (d *Dirs) App() string + func (d *Dirs) Banner() string + func (d *Dirs) CheckDB(path string) (DBAccess, error) + func (d *Dirs) ChildEnv(environ []string) []string + func (d *Dirs) ConfigFiles() []ConfigFile + func (d *Dirs) DaemonDiscovery() (string, Profile, error) + func (d *Dirs) DaemonProfile() Profile + func (d *Dirs) Ensure(k Kind) (string, error) + func (d *Dirs) EnsureSocketDir() (Socket, error) + func (d *Dirs) EnvName(suffix string) string + func (d *Dirs) EnvPrefix() string + func (d *Dirs) ForProfile(p Profile) (*Dirs, error) + func (d *Dirs) GitignoreBlock() string + func (d *Dirs) Global() Home + func (d *Dirs) HasProject() bool + func (d *Dirs) InitHome(path string, s Scope) error + func (d *Dirs) InitProject(dir string) (string, error) + func (d *Dirs) IsRelease() bool + func (d *Dirs) KindEnv(k Kind) string + func (d *Dirs) Kinds() []KindSpec + func (d *Dirs) Mode() Mode + func (d *Dirs) MoveLegacy(ctx context.Context) (MoveResult, error) + func (d *Dirs) Name(base string) string + func (d *Dirs) NameWith(base, sep string) string + func (d *Dirs) Path(k Kind) (string, error) + func (d *Dirs) PathIn(k Kind, s Scope) (string, error) + func (d *Dirs) Paths() []Entry + func (d *Dirs) Profile() Profile + func (d *Dirs) Project() (Home, error) + func (d *Dirs) ReleaseReason() string + func (d *Dirs) RunPath(f RunFile) (string, error) + func (d *Dirs) Socket() (Socket, error) + func (d *Dirs) VerifyFile(path string) error + func (d *Dirs) Warnings() []Warning + func (d *Dirs) WriteGitignore() (bool, error) + type Entry struct + Error string + Fallback bool + Git GitRule + Home Scope + Kind Kind + Note string + Path string + Rule Rule + Type EntryType + type EntryType string + const TypeFile + const TypeFolder + type GitRule string + const GitCommit + const GitIgnore + type Home struct + Base string + Data string + Fallback bool + Info *HomeInfo + Marker string + Note string + Rule Rule + Scope Scope + type HomeInfo struct + App string + Layout int + Scope Scope + type Kind string + const KindBackups + const KindCache + const KindConfig + const KindConfigLocal + const KindDB + const KindGitignore + const KindHome + const KindLogs + const KindRun + const KindShared + type KindOption func(*KindSpec) + func Anchored() KindOption + func Commit() KindOption + func Disposable() KindOption + func File(p string) KindOption + func Folder(p string) KindOption + func Ignore() KindOption + func Scoped(s Scope) KindOption + type KindSpec struct + Anchored bool + Disposable bool + Git GitRule + Name Kind + Path string + Scope Scope + Type EntryType + type LegacyHome struct + DaemonLocks []string + Dir string + type LegacyVerify func(src, dst string) error + type Lookup string + const HereOnly + const WalkUp + type Mode string + const ModeGlobal + const ModeProject + type MoveResult struct + From string + Note string + Status MoveStatus + To string + type MoveStatus string + const MoveAlready + const MoveBothExist + const MoveDone + const MoveNone + const MoveSkipped + type Option func(*config) + func WithAllowRoot(allow bool) Option + func WithBuildInfo(fn func() (*debug.BuildInfo, bool)) Option + func WithCacheTag(on bool) Option + func WithConfigReader(fn ConfigReader) Option + func WithDaemonProfile(name string) Option + func WithDevProfile(p Profile) Option + func WithDirName(name string) Option + func WithEnv(fn func(string) (string, bool)) Option + func WithEnvPrefix(prefix string) Option + func WithGitCommit(patterns ...string) Option + func WithGitIgnore(patterns ...string) Option + func WithHome(path string) Option + func WithHomeDir(fn func() (string, error)) Option + func WithKind(name Kind, opts ...KindOption) Option + func WithLayoutVersion(n int) Option + func WithLegacyHome(l LegacyHome) Option + func WithLegacyVerify(fn LegacyVerify) Option + func WithLookup(l Lookup) Option + func WithMode(m Mode) Option + func WithPerm(dir, file fs.FileMode) Option + func WithProfile(name string) Option + func WithProfiles(names ...Profile) Option + func WithRelease(release bool) Option + func WithReleaseProfile(p Profile) Option + func WithRunFile(f RunFile, name string) Option + func WithSocketMaxLen(n int) Option + func WithTempFallback(on bool) Option + func WithTestGuard(on bool) Option + func WithWorkDir(dir string) Option + func WithoutKind(name Kind) Option + type Profile string + const ProfileDev + const ProfileProd + type Rule string + const RuleDefaults + const RuleEnvHome + const RuleEnvKind + const RuleFlag + const RuleGlobal + const RulePointer + const RuleProject + const RuleTemp + const RuleWorktree + type RunFile string + const RunDaemonLock + const RunDiscovery + const RunLock + const RunPID + const RunSocket + const RunSocketFile + type Scope string + const ScopeBoth + const ScopeGlobal + const ScopeProject + const ScopeProjectElseGlobal + type Socket struct + Dir string + Fallback bool + Path string + PointerFile string + type Warning struct + Code WarningCode + Message string + type WarningCode string + const WarnCeilingDropped + const WarnCeilingRelative + const WarnEnvPointsToProd + const WarnPointerChain + const WarnPointerProfile + const WarnProfileEnvIgnored + const WarnWorktreeMainMissing