Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecTool ¶ added in v0.2.0
ExecTool is a helper for running a Tool. It creates an exec.Command with the provided context, connects stdout/stderr to the Tool buffers, and will reduce the process priority after starting if requested.
func ReduceProcessPriority ¶ added in v0.2.0
ReduceProcessPriority is a multi-os helper for reducing the run priority of a process.
Types ¶
type Check ¶
type Check interface {
Validate() error
}
Check is used to validate if conditions are met for executing a particular tool.
type Checks ¶
type Checks struct {
// contains filtered or unexported fields
}
Checks is a helper to run multiple Check in one go
type ExecutableCheck ¶
type ExecutableCheck struct { // Executable is the name of the executable to find Executable string }
ExecutableCheck is used to determine if a specific executable can be found in the PATH env variable
func (*ExecutableCheck) Validate ¶
func (e *ExecutableCheck) Validate() error
Validate calls exec.LookPath to find the specified executable
type Tool ¶ added in v0.2.0
type Tool interface { // Do should execute the program Do() error // DoWithContext should execute the program under the provided context DoWithContext(context.Context) error // GetCommand should return the name of the binary to execute (ffmpeg, mkvmerge, etc) GetCommand() string // GetCommandArgs should return a list of arguments to pass to the command GetCommandArgs() []string // GetStdout should return the stdout output after the program is executed GetStdout() []byte // GetStderr should return the stderr output after the program is executed GetStderr() []byte // GetOutputBuffers returns buffers for writing stdout and stderr to. GetOutputBuffers() (io.Writer, io.Writer) // IsLowPriority returns if the process should be run at low priority IsLowPriority() bool }
Tool is a wrapper for an executable program, responsible for generating all the command-line arguments needed to execute successfully.