cmdutil

package
v0.80.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCommand

func RunCommand(command string, opt CommandOption) (stdout, stderr string, exitCode int, err error)

RunCommand runs command (in two string) and returns stdout, stderr strings and its exit code.

func RunCommandArgs

func RunCommandArgs(cmdArgs []string, opt CommandOption) (stdout, stderr string, exitCode int, err error)

RunCommandArgs run the command

func RunCommandArgsContext added in v0.52.1

func RunCommandArgsContext(ctx context.Context, cmdArgs []string, opt CommandOption) (stdout, stderr string, exitCode int, err error)

RunCommandArgsContext runs command by args with context

func RunCommandContext added in v0.52.1

func RunCommandContext(ctx context.Context, command string, opt CommandOption) (stdout, stderr string, exitCode int, err error)

RunCommandContext runs command with context

Types

type CommandOption

type CommandOption struct {
	User            string
	Env             []string
	TimeoutDuration time.Duration
}

CommandOption carries a timeout duration.

Jump to

Keyboard shortcuts

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