Documentation ¶
Overview ¶
Package sdexec 运行外部程序
Index ¶
- Variables
- type Cmd
- func (cmd *Cmd) AddVars(vars map[string]string) *Cmd
- func (cmd *Cmd) New() *exec.Cmd
- func (cmd *Cmd) Run() error
- func (cmd *Cmd) RunConsole() error
- func (cmd *Cmd) RunOutput(combine bool) ([]byte, error)
- func (cmd *Cmd) RunOutputString(combine bool) (string, error)
- func (cmd *Cmd) RunResult() *Result
- func (cmd *Cmd) SetDir(wd string) *Cmd
- func (cmd *Cmd) SetTimeout(timeout time.Duration) *Cmd
- func (cmd *Cmd) SetVar(name, val string) *Cmd
- func (cmd *Cmd) SetVars(vars map[string]string) *Cmd
- type Env
- type Result
- type Rusage
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTimeout = sderr.New("timeout")
)
View Source
var (
NoEnv = Env{}
)
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
func (*Cmd) RunConsole ¶
type Result ¶
type Result struct { Name string // 程序名称 Args []string // 程序参数 Dir string // 程序的运行目录 Envs map[string]string // 程序的环境变量 Stdout []byte // 标准输出 Stderr []byte // 错误输出 Err error // 错误信息 Usage Rusage // 进程概况 }
func (*Result) StderrLines ¶
func (*Result) StderrString ¶
func (*Result) StdoutLines ¶
func (*Result) StdoutString ¶
Click to show internal directories.
Click to hide internal directories.