texec

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: Unlicense Imports: 10 Imported by: 0

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 是输出回调函数类型,用于接收每一行输出

Jump to

Keyboard shortcuts

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