exec

package
v0.0.0-...-15a64de Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRunCmdTimeout = time.Second * 3
)

Variables

This section is empty.

Functions

func RunCmd

func RunCmd(timeout time.Duration, env []string, command string, stdin io.Reader, args ...string) (string, error)

RunCmd executes the given command and arguments and stdin and ensures the command takes no longer than the timeout before the command is terminated.

Types

type ErrCommandFailed

type ErrCommandFailed struct {
	Err    error
	Status int
}

func (*ErrCommandFailed) Error

func (e *ErrCommandFailed) Error() string

func (*ErrCommandFailed) Is

func (e *ErrCommandFailed) Is(target error) bool

func (*ErrCommandFailed) Unwrap

func (e *ErrCommandFailed) Unwrap() error

type ErrCommandKilled

type ErrCommandKilled struct {
	Err    error
	Signal syscall.Signal
}

func (*ErrCommandKilled) Error

func (e *ErrCommandKilled) Error() string

func (*ErrCommandKilled) Is

func (e *ErrCommandKilled) Is(target error) bool

func (*ErrCommandKilled) Unwrap

func (e *ErrCommandKilled) Unwrap() error

Jump to

Keyboard shortcuts

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