Documentation ¶
Index ¶
- func ConcurrencyRun(name string, adapter ConcurrencyRunAdapter) (err error)
- func ReplaceCmdNameByEnv(name string, envs []string) string
- func RunShellCommandBytes(cmdStr []string) (out []byte, err error)
- func RunShellCommandString(cmdStr []string) (out string, err error)
- type ConcurrencyRunAdapter
- type InstructionLogPrint
- type InstructionParamsSeparator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcurrencyRun ¶
func ConcurrencyRun(name string, adapter ConcurrencyRunAdapter) (err error)
执行操作系统脚本或命令的方法
func ReplaceCmdNameByEnv ¶
func RunShellCommandBytes ¶
同步执行操作系统命令的方法(获取命令返回值) RunShellCommandString 执行shell命令,返回[]byte(包含stderr 和 stdout)
func RunShellCommandString ¶
同步执行操作系统命令的方法(获取命令返回值) RunShellCommandString 执行shell命令,返回字符串
Types ¶
type ConcurrencyRunAdapter ¶
type ConcurrencyRunAdapter interface { GetDir() (string, bool) //获取命令执行路径,bool为false时不需要设置 DealStdOut(string) error //标准输出 DealStdErr(string) error //标准错误输出 GetTimeOut() time.Duration //超时时间 GetEnvs() map[string]string //需要预置的环境变量 CloseLogFile() error //关闭日志文件 ErrResult() error //获取执行结果是否错误 }
执行操作系统脚本或命令所依赖的对象
type InstructionLogPrint ¶
type InstructionLogPrint interface {
IsLogPrint() bool // 自定义是否输出日志
}
type InstructionParamsSeparator ¶
type InstructionParamsSeparator interface {
Separator() string // 自定义命令行参数分隔符
}
Click to show internal directories.
Click to hide internal directories.