process

package
v2.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2015 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cat

func Cat(path string) string

Replicates how the command line tool `cat` works, but is more verbose about what it does

func Run

func Run(command string, arg ...string) (string, error)

func StartPTY

func StartPTY(c *exec.Cmd) (*os.File, error)

Types

type Process

type Process struct {
	Pid        int
	PTY        bool
	Script     string
	Env        []string
	ExitStatus string

	// This callback is called when the process offically starts
	StartCallback func()

	// For every line in the process output, this callback will be called
	// with the contents of the line
	LineCallback func(string)
	// contains filtered or unexported fields
}

func (Process) Create

func (p Process) Create() *Process

func (*Process) IsRunning

func (p *Process) IsRunning() bool

Returns whether or not the process is running

func (*Process) Kill

func (p *Process) Kill() error

func (*Process) Output

func (p *Process) Output() string

func (*Process) Start

func (p *Process) Start() error

Jump to

Keyboard shortcuts

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