exec

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	*exec.Cmd
}

Cmd is doing the same as the os/exec's Cmd, but this Cmd implements Executable interface to make mocking possible

func (*Cmd) Stdout

func (c *Cmd) Stdout(f io.Writer)

Stdout sets os/exec.Cmd's Stdout field

type CommandExecutor

type CommandExecutor func(string, ...string) Executable

CommandExecutor defines a function for Cmd instance creation

type Executable

type Executable interface {
	Run() error
	Start() error
	String() string
	Stdout(io.Writer)
}

Executable defines all methods which are needed at external calls

func Command

func Command(name string, args ...string) Executable

Command is the basic implementation of Cmd creation

Jump to

Keyboard shortcuts

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