util_cmd

package
v1.27.7 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Cwd  string
	App  string
	Args []string
	// You can have either a custom context or a timeout, not both
	Timeout        time.Duration
	TimeoutRetries int
	LogStdOut      bool
	LogStdErr      bool
	// debug functionality
	LogInput bool
}

func NewCommand

func NewCommand(appAndArgs ...string) Command

func NewCommandA

func NewCommandA(app string, args ...string) Command

func (Command) Run

func (c Command) Run(ctx context.Context) (CommandResult, error)

func (Command) WithApp

func (c Command) WithApp(app string, args ...string) Command

func (Command) WithCwd

func (c Command) WithCwd(cwd string) Command

func (Command) WithExtraArgs

func (c Command) WithExtraArgs(args ...string) Command

func (Command) WithLogging

func (c Command) WithLogging(args ...bool) Command

func (Command) WithStdErrLogging

func (c Command) WithStdErrLogging() Command

func (Command) WithStdLogging

func (c Command) WithStdLogging() Command

func (Command) WithStdOutLogging

func (c Command) WithStdOutLogging() Command

func (Command) WithTimeout

func (c Command) WithTimeout(timeout time.Duration) Command

func (Command) WithTimeoutRetries

func (c Command) WithTimeoutRetries(n int) Command

type CommandResult

type CommandResult struct {
	StdOut   string
	StdErr   string
	Combined string
	Err      error
	Attempts int
	Code     int
}

Jump to

Keyboard shortcuts

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