MCPcopy
hub / github.com/wavetermdev/waveterm / MakeSSHCmdClient

Function MakeSSHCmdClient

pkg/genconn/ssh-impl.go:44–57  ·  view source on GitHub ↗

MakeSSHCmdClient creates a new instance of SSHCmdClient

(client *ssh.Client, cmdSpec CommandSpec)

Source from the content-addressed store, hash-verified

42
43// MakeSSHCmdClient creates a new instance of SSHCmdClient
44func MakeSSHCmdClient(client *ssh.Client, cmdSpec CommandSpec) (*SSHProcessController, error) {
45 log.Printf("SSH-NEWSESSION (cmdclient)\n")
46 session, err := client.NewSession()
47 if err != nil {
48 return nil, fmt.Errorf("failed to create SSH session: %w", err)
49 }
50 return &SSHProcessController{
51 client: client,
52 lock: &sync.Mutex{},
53 once: &sync.Once{},
54 cmdSpec: cmdSpec,
55 session: session,
56 }, nil
57}
58
59// Start begins execution of the command
60func (s *SSHProcessController) Start() error {

Callers 2

CpWshToRemoteFunction · 0.92
MakeProcessControllerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected