Documentation ¶
Index ¶
- type Cmd
- func (c *Cmd) Background(background ...bool) *Cmd
- func (c *Cmd) Command(path string, args ...string) *Cmd
- func (c *Cmd) Context(ctx context.Context) *Cmd
- func (c *Cmd) DIR(dir string) *Cmd
- func (c *Cmd) Env(env []string) *Cmd
- func (c *Cmd) ErrOut(out ...io.Writer) *Cmd
- func (c *Cmd) ExitCode() int
- func (c *Cmd) GetName() string
- func (c *Cmd) GetOutput() (string, error)
- func (c *Cmd) Name(name string) *Cmd
- func (c *Cmd) OnExit(onExit ...func()) *Cmd
- func (c *Cmd) OnStatusChanged(onStatusChanged StatusChangedFunc) *Cmd
- func (c *Cmd) PID() PID
- func (c *Cmd) QuitWith(quit <-chan struct{}) *Cmd
- func (c *Cmd) ReadErr(readErr ReadFunc) *Cmd
- func (c *Cmd) ReadOut(readOut ReadFunc) *Cmd
- func (c *Cmd) Start() error
- func (c *Cmd) Status() Status
- func (c *Cmd) StdIn(in ...io.Reader) *Cmd
- func (c *Cmd) StdOut(out ...io.Writer) *Cmd
- func (c *Cmd) Stop() error
- func (c *Cmd) String() string
- func (c *Cmd) UseWindowsLegacyProcessStrategy(yes ...bool) *Cmd
- func (c *Cmd) UsedTime() time.Duration
- func (c *Cmd) Verbose(verbose ...bool) *Cmd
- func (c *Cmd) Wait() error
- type PID
- type ReadFunc
- type Status
- type StatusChangedFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
Cmd 命令
func CommandContext ¶
CommandContext 使用程序路径和参数创建一个命令 exec.CommandContext
func (*Cmd) Background ¶
Background 后台运行(不阻断 Start 方法)
func (*Cmd) OnStatusChanged ¶
func (c *Cmd) OnStatusChanged(onStatusChanged StatusChangedFunc) *Cmd
OnStatusChanged 设置状态变更监听
func (*Cmd) UseWindowsLegacyProcessStrategy ¶
UseWindowsLegacyProcessStrategy 使用传统进程管理(windows)
Click to show internal directories.
Click to hide internal directories.