command

package
v0.0.0-...-bf7d0e6 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseProcess

func CloseProcess(proc *os.Process, exitStrat string) error

func ReplaceArgVars

func ReplaceArgVars(args []string, vars map[string]string) []string

Types

type CommandRunner

type CommandRunner struct {
	Cmd        *exec.Cmd
	Config     *GMCConfig
	ResultChan chan RunResult
}

func (*CommandRunner) Cancel

func (cmdr *CommandRunner) Cancel() error

func (*CommandRunner) IsRunning

func (cmdr *CommandRunner) IsRunning() bool

func (*CommandRunner) ReplaceArgVars

func (cmdr *CommandRunner) ReplaceArgVars(args []string, vars map[string]string) []string

func (*CommandRunner) Run

type GMCConfig

type GMCConfig struct {
	MisterHost      string              `json:"mister_host"`
	ExitStrategy    string              `json:"exit_strategy"`
	ExitPauseMs     int                 `json:"exit_pause_ms"`
	DisplayMessages bool                `json:"display_messages"`
	Commands        []GMCConfigCommand  `json:"commands"`
	Generators      GMCConfigGenerators `json:"generators"`
	CmdMap          map[string]GMCConfigCommand
}

func LoadConfigFromPath

func LoadConfigFromPath(path string) (*GMCConfig, error)

type GMCConfigCommand

type GMCConfigCommand struct {
	Cmd      string   `json:"cmd"`
	WorkDir  string   `json:"work_dir"`
	ExecBin  string   `json:"exec_bin"`
	ExecArgs []string `json:"exec_args"`
}

type GMCConfigDirectoryGenerator

type GMCConfigDirectoryGenerator struct {
	Name       string              `json:"name"`
	Dir        string              `json:"dir"`
	Extensions []string            `json:"extensions"`
	Template   GroovyMiSTerCommand `json:"template"`
}

type GMCConfigGenerators

type GMCConfigGenerators struct {
	Mame        GMCConfigMameGenerator        `json:"mame"`
	Retroarch   GMCConfigRetroarchGenerator   `json:"retroarch"`
	Directories []GMCConfigDirectoryGenerator `json:"directories"`
}

type GMCConfigMameGenerator

type GMCConfigMameGenerator struct {
	RomsDir      string `json:"roms_dir"`
	MamelistPath string `json:"mamelist_path"`
}

type GMCConfigRetroarchGenerator

type GMCConfigRetroarchGenerator struct {
	PlaylistsDir string `json:"playlists_dir"`
}

type GroovyMiSTerCommand

type GroovyMiSTerCommand struct {
	Cmd  string            `json:"cmd"`
	Vars map[string]string `json:"vars"`
	Raw  []byte
}

func ParseGMC

func ParseGMC(cmdBytes []byte) (GroovyMiSTerCommand, error)

type ProcessStateError

type ProcessStateError struct {
	// contains filtered or unexported fields
}

func (*ProcessStateError) Error

func (err *ProcessStateError) Error() string

type RunResult

type RunResult struct {
	Code         int
	Message      string
	MessageLines []string
	BlitMessage  bool
}

Jump to

Keyboard shortcuts

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