process

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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) BuildEnv

func (b *EnvBuilder) BuildEnv(wt *data.Worktree, meta *data.Metadata) []string

BuildEnv creates environment variables for a worktree

func (*EnvBuilder) BuildEnvMap

func (b *EnvBuilder) BuildEnvMap(wt *data.Worktree, meta *data.Metadata) map[string]string

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

func (*ScriptRunner) RunSetup

func (r *ScriptRunner) RunSetup(wt *data.Worktree, meta *data.Metadata) error

RunSetup runs the setup scripts for a worktree

func (*ScriptRunner) Stop

func (r *ScriptRunner) Stop(wt *data.Worktree) error

Stop stops the running script for a worktree

func (*ScriptRunner) StopAll

func (r *ScriptRunner) StopAll()

StopAll stops all running scripts

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

Jump to

Keyboard shortcuts

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