Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandExecResult ¶
type CommandExecResult struct {
Success bool // Success 命令是否执行成功
CommandString string // CommandString 命令字符串
Output string // Output 命令执行输出
Error error // Error 命令执行错误
}
CommandExecResult 命令执行结果
func CommandExecute ¶
func CommandExecute(command string) CommandExecResult
CommandExecute 执行系统命令并打印结果 Args: command string 命令字符串 Returns: CommandExecResult 命令执行结果
func CommandExecuteStream ¶ added in v0.0.3
func CommandExecuteStream(command string, onOutput OutputCallback) CommandExecResult
CommandExecuteStream 执行命令并**持续流式输出**,通过回调函数处理每一行 Args:
command: 命令字符串 onOutput: 每当有一行输出时调用的回调函数
Returns: CommandExecResult
type OutputCallback ¶ added in v0.0.3
type OutputCallback func(line string)
OutputCallback 是输出回调函数类型,用于接收每一行输出
Click to show internal directories.
Click to hide internal directories.