Documentation
¶
Overview ¶
Package folders gives every session path one folder identity: the git repository, the linked worktree and the subfolder it runs in. Clients print Folder.Label and never derive names themselves.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Folder ¶
type Folder struct {
Repo string `json:"repo"` // shown name of the top folder
RepoPath string `json:"repoPath"` // its full path, the grouping key
Worktree string `json:"worktree,omitempty"` // linked worktree folder name; absent for the main checkout
Sub string `json:"sub,omitempty"` // path below the worktree top, "/"-separated
Label string `json:"label"` // "aimux / clients · ios"
}
Folder is the identity of a session's working directory.
type Resolver ¶
type Resolver struct {
Home string
CachePath string
// Git returns the top-level and the common git dir (both absolute) of dir.
Git func(dir string) (top, commonDir string, err error)
Exists func(string) bool
// Tick is how often Run resolves a batch; zero means the default.
Tick time.Duration
// contains filtered or unexported fields
}
Resolver maps session paths to Folders. Folder never runs git; Run does.
func NewResolver ¶
NewResolver builds a Resolver for the given home directory and cache file, loading the cache when it exists and parses.
func (*Resolver) Folder ¶
Folder returns the identity of path without running git. A path not yet resolved gets the non-git rule and is queued for Run.
func (*Resolver) ResolveNow ¶
ResolveNow resolves one path synchronously. A path that no longer exists is left on the non-git rule, so a deleted worktree never resolved stays that way.