runner

package
v0.0.0-...-1160ede Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 13

Documentation

Overview

Package runner provides utilities to execute commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Default

type Default struct{}

Default is the Runner that executes the command by default.

func (*Default) CmdCombinedOutput

func (*Default) CmdCombinedOutput(cmd *exec.Cmd) ([]byte, error)

CmdCombinedOutput executes the command and returns the command stdout and stderr.

func (*Default) CmdOutput

func (*Default) CmdOutput(cmd *exec.Cmd) ([]byte, error)

CmdOutput executes the command and returns the command stdout.

func (*Default) CmdRun

func (*Default) CmdRun(cmd *exec.Cmd) error

CmdRun executes the command.

type Fake

type Fake struct{}

Fake is the Runner that only prints command information and does not run it.

func (*Fake) CmdCombinedOutput

func (*Fake) CmdCombinedOutput(cmd *exec.Cmd) ([]byte, error)

CmdCombinedOutput prints the command information.

func (*Fake) CmdOutput

func (*Fake) CmdOutput(cmd *exec.Cmd) ([]byte, error)

CmdOutput prints the command information.

func (*Fake) CmdRun

func (*Fake) CmdRun(cmd *exec.Cmd) error

CmdRun prints the command information.

type Runner

type Runner interface {
	CmdRun(cmd *exec.Cmd) error
	CmdOutput(cmd *exec.Cmd) ([]byte, error)
	CmdCombinedOutput(cmd *exec.Cmd) ([]byte, error)
}

Runner is the interface to execute commands.

Jump to

Keyboard shortcuts

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