pkgexec

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

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

Go to latest
Published: Mar 28, 2016 License: MIT Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoArgs is the error returned if there are no arguments given.
	ErrNoArgs = errors.New("pkgexec: no arguments given")
)

Functions

func Chown

func Chown(filePath string) error

Chown changes the filepath to be owned by the current user and group. It uses 'sudo chown' and 'sudo chgrp'.

TODO(pedge): how to escalate privileges from go?

func Run

func Run(args ...string) error

Run runs the command with the given arguments.

func RunDirPath

func RunDirPath(dirPath string, args ...string) error

RunDirPath runs the command with the given arguments in the given directory specified by dirPath.

func RunIO

func RunIO(ioObj IO, args ...string) error

RunIO runs the command with the given IO and arguments.

func RunIODirPath

func RunIODirPath(ioObj IO, dirPath string, args ...string) error

RunIODirPath runs the command with the given IO and arguments in the given directory specified by dirPath.

func RunOutput

func RunOutput(args ...string) ([]byte, error)

RunOutput runs the command with the given arguments and returns the output of stdout.

func RunOutputDirPath

func RunOutputDirPath(dirPath string, args ...string) ([]byte, error)

RunOutputDirPath runs the command with the given arguments in the given directory and returns the output of stdout.

func RunStderr

func RunStderr(stderr io.Writer, args ...string) error

RunStderr runs the command with the given stderr and arguments.

func RunStdin

func RunStdin(stdin io.Reader, args ...string) error

RunStdin runs the command with the given stdin and arguments.

func RunStdout

func RunStdout(stdout io.Writer, args ...string) error

RunStdout runs the command with the given stdout and arguments.

func SetDebug

func SetDebug(debug bool)

SetDebug sets debug mode for This will log commands at the debug level, and include the output of a command in the resulting error if the command fails.

Types

type IO

type IO struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

IO defines the inputs and outputs for a command.

type RunningCommand

type RunningCommand struct {
	Args string `protobuf:"bytes,1,opt,name=args" json:"args,omitempty"`
}

func (*RunningCommand) Descriptor

func (*RunningCommand) Descriptor() ([]byte, []int)

func (*RunningCommand) ProtoMessage

func (*RunningCommand) ProtoMessage()

func (*RunningCommand) Reset

func (m *RunningCommand) Reset()

func (*RunningCommand) String

func (m *RunningCommand) String() string

Jump to

Keyboard shortcuts

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