MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / NewSSHRemote

Function NewSSHRemote

cli/pkg/common/sshremote.go:63–82  ·  view source on GitHub ↗

实例

(host string, port int, userName, password string, idRsa string)

Source from the content-addressed store, hash-verified

61
62// 实例
63func NewSSHRemote(host string, port int, userName, password string, idRsa string) (instance SSHRemote, err error) {
64
65 instance = SSHRemote{}
66
67 if (instance.Connection == &ssh.Client{}) || instance.Connection == nil {
68 instance.SSHHost = host
69 instance.SSHPort = port
70 instance.SSHUserName = userName
71 instance.SSHPassword = password
72
73 connection, err := connectionDial(host, port, userName, password, idRsa)
74 if err != nil {
75 return instance, err
76 }
77
78 instance.Connection = connection
79 }
80
81 return instance, nil
82}
83
84// 验证
85func (instance *SSHRemote) CheckDail(host string, port int, userName, password string, idRsa string) error {

Callers

nothing calls this directly

Calls 1

connectionDialFunction · 0.85

Tested by

no test coverage detected