* detect kill ssh session * include sftp session in the count of ssh sessions * log session type in the agent
20 lines
445 B
Go
20 lines
445 B
Go
package terminal
|
|
|
|
import (
|
|
"github.com/gliderlabs/ssh"
|
|
"io"
|
|
)
|
|
|
|
type Process interface {
|
|
Pipe() io.ReadWriter
|
|
Kill() error
|
|
Wait() error
|
|
}
|
|
|
|
// A function definition used to start processes
|
|
type Spawner func(sshSession ssh.Session, env []string, name string, arg ...string) (Process, error)
|
|
|
|
func (s Spawner) Start(sshSession ssh.Session, env []string, name string, arg ...string) (Process, error) {
|
|
return s(sshSession, env, name, arg...)
|
|
}
|