Documentation
¶
Index ¶
- type EnvBuilder
- type PortAllocator
- type ScriptRunner
- func (r *ScriptRunner) IsRunning(wt *data.Worktree) bool
- func (r *ScriptRunner) LoadConfig(repoPath string) (*WorktreeConfig, error)
- func (r *ScriptRunner) RunScript(wt *data.Worktree, meta *data.Metadata, scriptType ScriptType) (*exec.Cmd, error)
- func (r *ScriptRunner) RunSetup(wt *data.Worktree, meta *data.Metadata) error
- func (r *ScriptRunner) Stop(wt *data.Worktree) error
- func (r *ScriptRunner) StopAll()
- type ScriptType
- type WorktreeConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnvBuilder ¶
type EnvBuilder struct {
// contains filtered or unexported fields
}
EnvBuilder builds environment variables for script execution
func NewEnvBuilder ¶
func NewEnvBuilder(ports *PortAllocator) *EnvBuilder
NewEnvBuilder creates a new environment builder
func (*EnvBuilder) BuildEnvMap ¶
BuildEnvMap creates a map of environment variables
type PortAllocator ¶
type PortAllocator struct {
// contains filtered or unexported fields
}
PortAllocator manages port allocation for worktrees
func NewPortAllocator ¶
func NewPortAllocator(start, rangeSize int) *PortAllocator
NewPortAllocator creates a new port allocator
func (*PortAllocator) AllocatePort ¶
func (p *PortAllocator) AllocatePort(worktreeRoot string) int
AllocatePort allocates a port range for a worktree
func (*PortAllocator) GetPort ¶
func (p *PortAllocator) GetPort(worktreeRoot string) (int, bool)
GetPort returns the allocated port for a worktree
func (*PortAllocator) PortRange ¶
func (p *PortAllocator) PortRange(worktreeRoot string) (port int, rangeEnd int)
PortRange returns the port and range size for a worktree
func (*PortAllocator) ReleasePort ¶
func (p *PortAllocator) ReleasePort(worktreeRoot string)
ReleasePort releases the port allocation for a worktree
type ScriptRunner ¶
type ScriptRunner struct {
// contains filtered or unexported fields
}
ScriptRunner manages script execution for worktrees
func NewScriptRunner ¶
func NewScriptRunner(portStart, portRange int) *ScriptRunner
NewScriptRunner creates a new script runner
func (*ScriptRunner) IsRunning ¶
func (r *ScriptRunner) IsRunning(wt *data.Worktree) bool
IsRunning checks if a script is running for a worktree
func (*ScriptRunner) LoadConfig ¶
func (r *ScriptRunner) LoadConfig(repoPath string) (*WorktreeConfig, error)
LoadConfig loads the worktree configuration from the repo
func (*ScriptRunner) RunScript ¶
func (r *ScriptRunner) RunScript(wt *data.Worktree, meta *data.Metadata, scriptType ScriptType) (*exec.Cmd, error)
RunScript runs a script for a worktree
type ScriptType ¶
type ScriptType string
ScriptType identifies the type of script
const ( ScriptSetup ScriptType = "setup" ScriptRun ScriptType = "run" ScriptArchive ScriptType = "archive" )
type WorktreeConfig ¶
type WorktreeConfig struct {
SetupWorktree []string `json:"setup-worktree"`
RunScript string `json:"run"`
ArchiveScript string `json:"archive"`
}
WorktreeConfig holds per-project worktree configuration