Documentation
¶
Overview ¶
Package headless provides headless execution of cheats without a TUI. It is utilized when variable resolution can be completed automatically or via command-line flags, bypassing the interactive UI entirely.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var IdleTimeout = 5 * time.Minute
IdleTimeout defines the maximum duration a command can run without producing output before being forcefully killed.
Functions ¶
Types ¶
type Executor ¶
type Executor interface {
RunShell(command string) (string, error)
BuildFinalCommand(cheat *parser.Cheat) string
OutputWithMode(command string, mode executor.OutputMode) error
}
Executor defines the interface required by the headless runner for shell command execution.
type RunnerSession ¶
type RunnerSession struct {
Index *parser.CheatIndex
Exec Executor
Cheat *parser.Cheat
Vars []resolver.VarState
Decoder *json.Decoder
Out io.Writer
}
RunnerSession encapsulates the state and lifecycle of a command execution process. It orchestrates variable resolution and final command execution.
func (*RunnerSession) Execute ¶
func (s *RunnerSession) Execute(initialQuery, matchCmd string) error
Execute initiates the command execution lifecycle. It locates the target cheat, resolves required variables, and executes the finalized command.