Documentation
¶
Index ¶
- func Exec(raw json.RawMessage) (interface{}, error)
- func Stream(raw json.RawMessage, conn Conn) (interface{}, error)
- type Conn
- type ExecParams
- type ExecResult
- type Manager
- type PtyManager
- type PtyParams
- type PtyProcess
- type ResizeParams
- type SignalParams
- type SpawnParams
- type SpawnedProcess
- type StdinParams
- type StreamParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exec ¶
func Exec(raw json.RawMessage) (interface{}, error)
Exec runs a command synchronously and returns its output.
Types ¶
type ExecParams ¶
type ExecParams struct {
Command string `json:"command"`
Env map[string]string `json:"env,omitempty"`
Timeout int `json:"timeout,omitempty"`
Cwd string `json:"cwd,omitempty"`
}
ExecParams is the params for process.exec.
type ExecResult ¶
type ExecResult struct {
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
ExitCode int `json:"exit_code"`
}
ExecResult is the result of process.exec.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager tracks spawned processes.
func (*Manager) Signal ¶
func (m *Manager) Signal(raw json.RawMessage) (interface{}, error)
Signal sends a signal to a spawned process.
func (*Manager) Spawn ¶
func (m *Manager) Spawn(raw json.RawMessage, conn Conn) (interface{}, error)
Spawn starts a process in the background and streams output as notifications.
func (*Manager) WriteStdin ¶
func (m *Manager) WriteStdin(raw json.RawMessage) (interface{}, error)
WriteStdin writes data to a spawned process's stdin.
type PtyManager ¶
type PtyManager struct {
// contains filtered or unexported fields
}
PtyManager tracks PTY processes.
func (*PtyManager) Cleanup ¶
func (m *PtyManager) Cleanup()
Cleanup kills all PTY process groups and closes their master fds.
func (*PtyManager) HasPty ¶
func (m *PtyManager) HasPty(pid int) bool
HasPty checks if a PID belongs to a PTY process.
func (*PtyManager) Resize ¶
func (m *PtyManager) Resize(raw json.RawMessage) (interface{}, error)
Resize changes the terminal size of a PTY process.
func (*PtyManager) StartPty ¶
func (m *PtyManager) StartPty(raw json.RawMessage, conn io.ReadWriter) (interface{}, error)
StartPty starts a command with a PTY and streams output as binary frames.
func (*PtyManager) WritePtyInput ¶
func (m *PtyManager) WritePtyInput(pid int, data []byte) error
WritePtyInput writes binary data to a PTY's master fd.
type PtyParams ¶
type PtyParams struct {
Command string `json:"command,omitempty"`
Cols uint16 `json:"cols,omitempty"`
Rows uint16 `json:"rows,omitempty"`
Env map[string]string `json:"env,omitempty"`
Cwd string `json:"cwd,omitempty"`
}
PtyParams is the params for process.pty.
type PtyProcess ¶
type PtyProcess struct {
// contains filtered or unexported fields
}
PtyProcess tracks a running PTY process.
type ResizeParams ¶
type ResizeParams struct {
PID int `json:"pid"`
Cols uint16 `json:"cols"`
Rows uint16 `json:"rows"`
}
ResizeParams is the params for process.resize.
type SignalParams ¶
SignalParams is the params for process.signal.
type SpawnParams ¶
type SpawnParams struct {
Command string `json:"command"`
Env map[string]string `json:"env,omitempty"`
Cwd string `json:"cwd,omitempty"`
}
SpawnParams is the params for process.spawn.
type SpawnedProcess ¶
type SpawnedProcess struct {
// contains filtered or unexported fields
}
SpawnedProcess tracks a running spawned process.
type StdinParams ¶
StdinParams is the params for process.stdin.