util

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomID

func RandomID() string

func RunCmd

func RunCmd(cmd *exec.Cmd) error

func RunCmdOut

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

Types

type Command

type Command interface {
	RunCmdOut(cmd *exec.Cmd) ([]byte, error)
	RunCmd(cmd *exec.Cmd) error
}

Command is an interface used to run commands. All packages should use this interface instead of calling exec.Cmd directly.

var DefaultExecCommand Command = &Commander{}

DefaultExecCommand runs commands using exec.Cmd

type Commander

type Commander struct{}

Commander is the exec.Cmd implementation of the Command interface

func (*Commander) RunCmd

func (*Commander) RunCmd(cmd *exec.Cmd) error

RunCmd runs an exec.Command.

func (*Commander) RunCmdOut

func (*Commander) RunCmdOut(cmd *exec.Cmd) ([]byte, error)

RunCmdOut runs an exec.Command and returns the stdout and error.

Jump to

Keyboard shortcuts

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