headless

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 12 Imported by: 0

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

View Source
var IdleTimeout = 5 * time.Minute

IdleTimeout defines the maximum duration a command can run without producing output before being forcefully killed.

Functions

func Run

func Run(index *parser.CheatIndex, exec Executor, initialQuery, matchCmd string, out io.Writer) error

Run acts as the primary entry point, constructing a session and starting the execution.

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.

Jump to

Keyboard shortcuts

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