exec

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package exec wraps os/exec to add a little error sanitization and standardization around process return codes and a channel-based cancel mechanism

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunWithCancel

func RunWithCancel(cmd *exec.Cmd, cancelCh chan struct{}) error

Types

type CmdRunResult

type CmdRunResult struct {
	Stdout   string
	Stderr   string
	ExitCode int
	Error    error
	Finished bool
}

func NewCmdRunResultWithErr

func NewCmdRunResultWithErr(err error) CmdRunResult

func (*CmdRunResult) AttachErrorf

func (r *CmdRunResult) AttachErrorf(msg string, err error)

func (CmdRunResult) ErrorStr

func (r CmdRunResult) ErrorStr() string

func (CmdRunResult) WithFriendlyYAMLStrings

func (r CmdRunResult) WithFriendlyYAMLStrings() CmdRunResult

type Flag

type Flag struct {
	Name  string // e.g. --name
	Value string
}

func NewFlagFromString

func NewFlagFromString(str string) (Flag, error)

type FlagSet added in v0.13.0

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

func NewFlagSet added in v0.13.0

func NewFlagSet(optss ...[]string) FlagSet

func (FlagSet) Includes added in v0.13.0

func (s FlagSet) Includes(name string) bool

Jump to

Keyboard shortcuts

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