runners

package
v3.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package runners provides an interface to execute commands.

Index

Constants

View Source
const (
	// LogsEnabledDefault defines logs enabling.
	LogsEnabledDefault = true

	// Hidden marks a hidden output.
	Hidden = "HIDDEN"
)

Variables

This section is empty.

Functions

func NewRunnerError

func NewRunnerError(command string, stderr string, e error) error

NewRunnerError creates a new RunnerError instance.

Types

type LocalRunner

type LocalRunner struct {
	UseSudo bool
}

LocalRunner represents implementation of a local runner.

func NewLocalRunner

func NewLocalRunner(useSudo bool) *LocalRunner

NewLocalRunner creates a new LocalRunner instance.

func (*LocalRunner) Run

func (r *LocalRunner) Run(command string, options ...bool) (string, error)

Run executes command.

type Runner

type Runner interface {
	Run(string, ...bool) (string, error)
}

Runner runs commands.

type RunnerError

type RunnerError struct {
	Msg        string
	ExitStatus int
	Stderr     string
}

RunnerError represents a runner error.

func (RunnerError) Error

func (e RunnerError) Error() string

Error returns runner error.

Jump to

Keyboard shortcuts

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