scmd

package
v1.4.13 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Newprogress

func Newprogress(dir, name string, arg ...string) (prog *progress, stdout chan []byte, stderr chan []byte, er error)

Types

type Scmd

type Scmd struct {
	// contains filtered or unexported fields
}

func NewScmd

func NewScmd(name string, arg ...string) *Scmd

func NewScmdWithDir added in v1.0.32

func NewScmdWithDir(dir string, name string, arg ...string) *Scmd

func (*Scmd) IsStop

func (m *Scmd) IsStop() bool

func (*Scmd) Signal

func (m *Scmd) Signal(sig os.Signal) error

给进程发信号

func (*Scmd) Start

func (m *Scmd) Start() (stdout chan []byte, stderr chan []byte, er error)

func (*Scmd) StartTimeoutWaitOutput

func (m *Scmd) StartTimeoutWaitOutput(timeout time.Duration) (stdout []byte, stderr []byte, er error)

func (*Scmd) StartWaitOutput

func (m *Scmd) StartWaitOutput() (stdout []byte, stderr []byte, er error)

阻塞调用, 直到程序结束才会返回

func (*Scmd) Stop

func (m *Scmd) Stop(timeout time.Duration) error

stop失败时候,返回错误原因 其他成功,即使已经stop,再stop也不报错误

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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