Documentation ¶
Overview ¶
Package osexec provides SystemExecConfig.
Index ¶
- type SystemExecConfig
- type SystemProcess
- func (sp *SystemProcess) Cleanup() (killed bool)
- func (sp *SystemProcess) Init(ctx context.Context, detector logging.MemoryLeakDetector, isPty bool) error
- func (sp *SystemProcess) Start(detector logging.MemoryLeakDetector, Term string, ...) (*os.File, error)
- func (sp *SystemProcess) Stderr() (io.ReadCloser, error)
- func (sp *SystemProcess) Stdin() (io.WriteCloser, error)
- func (sp *SystemProcess) Stdout() (io.ReadCloser, error)
- func (sp *SystemProcess) String() string
- func (sp *SystemProcess) Wait(detector logging.MemoryLeakDetector) (code int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SystemExecConfig ¶
type SystemExecConfig struct { // Shell is the shell to use for the server // This is called like `shell -c "command"“ when an ssh command is provided or like `shell` when not. // The shell is passed to exec.LookPath(). Shell string }
SystemExecConfig implements a proxyssh.Configuration and proxyssh.Handler that execute user processes using the real system.
func (*SystemExecConfig) Handle ¶
func (cfg *SystemExecConfig) Handle(logger logging.Logger, session ssh.Session) (proxyssh.Process, error)
Handle handles a new configuration thingy
func (*SystemExecConfig) RegisterFlags ¶
func (cfg *SystemExecConfig) RegisterFlags(flagset *flag.FlagSet)
RegisterFlags registers flags representing the config to the provided flagset. When flagset is nil, uses flag.CommandLine.
type SystemProcess ¶
type SystemProcess struct {
// contains filtered or unexported fields
}
SystemProcess represents a process that is run using a the shell on the current machine
func NewSystemProcess ¶
func NewSystemProcess(command string, args []string) *SystemProcess
NewSystemProcess creates a new system process
func (*SystemProcess) Cleanup ¶
func (sp *SystemProcess) Cleanup() (killed bool)
Cleanup cleans up this process, typically killing it
func (*SystemProcess) Init ¶
func (sp *SystemProcess) Init(ctx context.Context, detector logging.MemoryLeakDetector, isPty bool) error
Init initializes this process
func (*SystemProcess) Start ¶
func (sp *SystemProcess) Start(detector logging.MemoryLeakDetector, Term string, resizeChan <-chan proxyssh.WindowSize, isPty bool) (*os.File, error)
Start starts this process
func (*SystemProcess) Stderr ¶
func (sp *SystemProcess) Stderr() (io.ReadCloser, error)
Stderr returns a pipe to Stderr
func (*SystemProcess) Stdin ¶
func (sp *SystemProcess) Stdin() (io.WriteCloser, error)
Stdin returns a pipe to Stdin
func (*SystemProcess) Stdout ¶
func (sp *SystemProcess) Stdout() (io.ReadCloser, error)
Stdout returns a pipe to Stdout
func (*SystemProcess) String ¶
func (sp *SystemProcess) String() string
String turns ShellProcess into a string
func (*SystemProcess) Wait ¶
func (sp *SystemProcess) Wait(detector logging.MemoryLeakDetector) (code int, err error)
Wait waits for the process and returns the exit code