package
1.3.48
Repository: https://github.com/sandwich-go/boost.git
Documentation: pkg.go.dev

# README

xproc

command 辅助函数

  • process 启动、关闭、killSignal 管理
  • process 集管理

例子

tmpFile := filepath.Join(os.TempDir(), "test.sh")
err := xos.FilePutContents(tmpFile, []byte("echo \"GOT ME $1\""))
xpanic.WhenError(err)
var stdOut string
stdOut, err = ShellRun(tmpFile, WithArgs("1.2.0"))
xpanic.WhenError(err)
fmt.Println(stdOut)

Output:

GOT ME 1.2.0

# Functions

InstallProcessOptionsWatchDog the installed func will called when NewProcessOptions called.
No description provided by the author
NewProcess creates and returns a new Process.
NewProcessOptions new ProcessOptions.
NewProcessShellCmdWithOptions creates and returns a process with given command and optional environment variable array.
NewProcess creates and returns a new Process.
go:generate optiongen --option_return_previous=false.
Run 运行指定命令 Note: 接管stdOut,stdErr,数据被缓存不会随执行输出 同时将stdError的内容看做错误以error返回.
ShellRun 启动shell运行指定命令 Note: 接管stdOut,stdErr,数据被缓存不会随执行输出 同时将stdError的内容看做错误以error返回.
WithArgs option func for filed Args.
WithEnv option func for filed Env.
WithStderr option func for filed Stderr.
WithStdin option func for filed Stdin.
WithStdout option func for filed Stdout.
WithWorkingDir option func for filed WorkingDir.

# Variables

No description provided by the author

# Structs

No description provided by the author
No description provided by the author
ProcessOptions should use NewProcessOptions to initialize it.

# Interfaces

ProcessOptionsInterface visitor + ApplyOption interface for ProcessOptions.
ProcessOptionsVisitor visitor interface for ProcessOptions.

# Type aliases

ProcessOption option func.