Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commander ¶
type Commander interface {
// 执行命令行并返回结果
// args: 命令行参数
// return: 进程的pid, 命令行结果, 错误消息
Exec(args ...string) (int, string, error)
// 异步执行命令行并通过channel返回结果
// stdout: chan结果
// args: 命令行参数
// return: 进程的pid
// exception: 协程内的命令行发生错误时,会panic异常
ExecAsync(stdout chan string, args ...string) int
// 执行命令行(忽略返回值)
// args: 命令行参数
// return: 错误消息
ExecIgnoreResult(args ...string) error
}
命令行接口
type LinuxCommand ¶
type LinuxCommand struct {
}
LinuxCommand结构体
func (*LinuxCommand) Exec ¶
func (lc *LinuxCommand) Exec(args ...string) (int, string, error)
执行命令行并返回结果 args: 命令行参数 return: 进程的pid, 命令行结果, 错误消息
func (*LinuxCommand) ExecAsync ¶
func (lc *LinuxCommand) ExecAsync(stdout chan string, args ...string) int
异步执行命令行并通过channel返回结果 stdout: chan结果 args: 命令行参数 return: 进程的pid exception: 协程内的命令行发生错误时,会panic异常
func (*LinuxCommand) ExecIgnoreResult ¶
func (lc *LinuxCommand) ExecIgnoreResult(args ...string) error
执行命令行(忽略返回值) args: 命令行参数 return: 错误消息
type WindowsCommand ¶
type WindowsCommand struct {
}
WindowsCommand结构体
func (*WindowsCommand) Exec ¶
func (lc *WindowsCommand) Exec(args ...string) (int, string, error)
执行命令行并返回结果 args: 命令行参数 return: 进程的pid, 命令行结果, 错误消息
func (*WindowsCommand) ExecAsync ¶
func (lc *WindowsCommand) ExecAsync(stdout chan string, args ...string) int
异步执行命令行并通过channel返回结果 stdout: chan结果 args: 命令行参数 return: 进程的pid exception: 协程内的命令行发生错误时,会panic异常
func (*WindowsCommand) ExecIgnoreResult ¶
func (lc *WindowsCommand) ExecIgnoreResult(args ...string) error
执行命令行(忽略返回值) args: 命令行参数 return: 错误消息
Click to show internal directories.
Click to hide internal directories.