Documentation
¶
Index ¶
- type Command
- func (s *Command) AfterExec(f func(command *Command, cmd *exec.Cmd, err error)) *Command
- func (s *Command) AfterExited(f func(command *Command, cmd *exec.Cmd, err error)) *Command
- func (s *Command) Args(args ...string) *Command
- func (s *Command) Async(async bool) *Command
- func (s *Command) AsyncCallback(asyncCallback func(cmd *Command, output string, err error)) *Command
- func (s *Command) BeforeExec(f func(command *Command, cmd *exec.Cmd)) *Command
- func (s *Command) Cmd() *exec.Cmd
- func (s *Command) Detach(detach bool) *Command
- func (s *Command) Env(env map[string]string) *Command
- func (s *Command) Exec() (output string, e error)
- func (s *Command) ExecAsync() (e error)
- func (s *Command) Kill()
- func (s *Command) Log(log gcore.Logger) *Command
- func (s *Command) Output(w io.Writer) *Command
- func (s *Command) StrictMode(strictMode bool) *Command
- func (s *Command) TermType(termType TermType) *Command
- func (s *Command) Timeout(timeout time.Duration) *Command
- func (s *Command) WorkDir(workDir string) *Command
- type TermType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func NewCommand ¶
func (*Command) AfterExited ¶
func (*Command) Async ¶
Async create a goroutine to wait the command exited, the command be synchronized executed if current process exited, the child process will be exited
func (*Command) AsyncCallback ¶
func (*Command) BeforeExec ¶
func (*Command) Detach ¶
Detach make subprocess detach form current process. If current process exited, the child process will not be exited.
Note: this feature only working in go version >=1.20
func (*Command) StrictMode ¶
type TermType ¶
type TermType string
const ( TermXterm TermType = "xterm" TermXterm256Color TermType = "xterm-256color" TermVt100 TermType = "vt100" TermRxvt TermType = "rxvt" TermGnome TermType = "gnome-terminal" TermKonsole TermType = "konsole" TermTmux TermType = "tmux" TermScreen TermType = "screen" TermAnsi TermType = "ansi" TermNull TermType = "" )
Click to show internal directories.
Click to hide internal directories.