Documentation ¶
Index ¶
- type BaseCmd
- func (b *BaseCmd) GetArgs() []string
- func (b *BaseCmd) GetDir() string
- func (b *BaseCmd) GetEnv() []string
- func (b *BaseCmd) GetExtraFiles() []*os.File
- func (b *BaseCmd) GetPath() string
- func (b *BaseCmd) GetProcess() *os.Process
- func (b *BaseCmd) GetProcessState() *os.ProcessState
- func (b *BaseCmd) GetStderr() io.Writer
- func (b *BaseCmd) GetStdin() io.Reader
- func (b *BaseCmd) GetStdout() io.Writer
- func (b *BaseCmd) GetSysProcAttr() *syscall.SysProcAttr
- func (b *BaseCmd) SetArgs(value []string)
- func (b *BaseCmd) SetDir(value string)
- func (b *BaseCmd) SetEnv(value []string)
- func (b *BaseCmd) SetExtraFiles(value []*os.File)
- func (b *BaseCmd) SetPath(value string)
- func (b *BaseCmd) SetStderr(value io.Writer)
- func (b *BaseCmd) SetStdin(value io.Reader)
- func (b *BaseCmd) SetStdout(value io.Writer)
- func (b *BaseCmd) SetSysProcAttr(value *syscall.SysProcAttr)
- type Cmd
- type Exec
- type MemCmd
- func (m *MemCmd) CombinedOutput() ([]byte, error)
- func (m *MemCmd) Output() ([]byte, error)
- func (m *MemCmd) Run() error
- func (m *MemCmd) Start() error
- func (m *MemCmd) StderrPipe() (io.ReadCloser, error)
- func (m *MemCmd) StdinPipe() (io.WriteCloser, error)
- func (m *MemCmd) StdoutPipe() (io.ReadCloser, error)
- func (m *MemCmd) Wait() error
- type MemExec
- type OsCmd
- type OsExec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseCmd ¶
BaseCmd implements basic functions of cmd
func (*BaseCmd) GetExtraFiles ¶
GetExtraFiles return the Cmd's ExtraFiles
func (*BaseCmd) GetProcess ¶
GetProcess return the Cmd's Process
func (*BaseCmd) GetProcessState ¶
func (b *BaseCmd) GetProcessState() *os.ProcessState
GetProcessState return the Cmd's ProcessState
func (*BaseCmd) GetSysProcAttr ¶
func (b *BaseCmd) GetSysProcAttr() *syscall.SysProcAttr
GetSysProcAttr return the Cmd's SysProcAttr
func (*BaseCmd) SetExtraFiles ¶
SetExtraFiles set Command's ExtraFiles
func (*BaseCmd) SetSysProcAttr ¶
func (b *BaseCmd) SetSysProcAttr(value *syscall.SysProcAttr)
SetSysProcAttr set Command's SysProcAttr
type Cmd ¶
type Cmd interface { SetPath(string) SetArgs([]string) SetEnv([]string) SetDir(string) SetStdin(io.Reader) SetStdout(io.Writer) SetStderr(io.Writer) SetExtraFiles([]*os.File) SetSysProcAttr(*syscall.SysProcAttr) GetPath() string GetArgs() []string GetEnv() []string GetDir() string GetStdin() io.Reader GetStdout() io.Writer GetStderr() io.Writer GetExtraFiles() []*os.File GetSysProcAttr() *syscall.SysProcAttr GetProcess() *os.Process GetProcessState() *os.ProcessState CombinedOutput() ([]byte, error) Output() ([]byte, error) Run() error Start() error StderrPipe() (io.ReadCloser, error) StdinPipe() (io.WriteCloser, error) StdoutPipe() (io.ReadCloser, error) Wait() error }
Cmd represents an external command being prepared or run
type Exec ¶
type Exec interface { Command(name string, arg ...string) Cmd CommandContext(ctx context.Context, name string, arg ...string) Cmd }
Exec runs external commands.
type MemCmd ¶
MemCmd implements Cmd using memory
func (*MemCmd) CombinedOutput ¶
CombinedOutput implements CombinedOutput of Cmd
func (*MemCmd) StderrPipe ¶
func (m *MemCmd) StderrPipe() (io.ReadCloser, error)
StderrPipe implements StderrPipe of Cmd
func (*MemCmd) StdinPipe ¶
func (m *MemCmd) StdinPipe() (io.WriteCloser, error)
StdinPipe implements StdinPipe of Cmd
func (*MemCmd) StdoutPipe ¶
func (m *MemCmd) StdoutPipe() (io.ReadCloser, error)
StdoutPipe implements StdoutPipe of Cmd
type MemExec ¶
type MemExec struct { CombinedOutputCallback func(*MemCmd) ([]byte, error) OutputCallback func(*MemCmd) ([]byte, error) RunCallback func(*MemCmd) error StartCallback func(*MemCmd) error StderrPipeCallback func(*MemCmd) (io.ReadCloser, error) StdinPipeCallback func(*MemCmd) (io.WriteCloser, error) StdoutPipeCallback func(*MemCmd) (io.ReadCloser, error) WaitCallback func(*MemCmd) error }
MemExec implements Exec using callbacks
Click to show internal directories.
Click to hide internal directories.