Documentation
¶
Overview ¶
Package index owns the branch→index mapping of a project's worktrees. The index feeds the port formula and the compose project name, so it must never change once a stack exists: allocated once, recorded in the registry, and recovered from docker for worktrees that predate the recording.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoIndex = errors.New("no recorded index")
ErrNoIndex means the branch has no recorded index and no docker trace: as far as stacks are concerned, this worktree never started one.
Functions ¶
func MatchBranch ¶
MatchBranch finds the label belonging to this repo and branch among compose project labels. It extracts the candidate integer then rebuilds the canonical name, so stack.ProjectName stays the single naming authority.
Types ¶
type Mode ¶
type Mode int
Mode says whether a resolution may invent a new index. Commands that bring a stack up may; commands that address an existing stack (stop, remove, exec) must not, or they would "find" a stack that never existed.
type Resolver ¶
type Resolver struct {
ConfigPath string
Runner execx.Runner
Name string // project name in the registry
RepoName string // filepath.Base of the project directory
Out io.Writer
}