process

package
v3.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: May 10, 2018 License: MIT Imports: 20 Imported by: 67

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 FormatCommand

func FormatCommand(command string, args []string) string

FormatCommand formats a command amd arguments for human reading

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
	Timestamp  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 if its filter returns true.
	LineCallback       func(string)
	LinePreProcessor   func(string) string
	LineCallbackFilter func(string) bool
	// contains filtered or unexported fields
}

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