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

Method CheckDail

cli/pkg/common/sshremote.go:85–99  ·  view source on GitHub ↗

验证

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

Source from the content-addressed store, hash-verified

83
84// 验证
85func (instance *SSHRemote) CheckDail(host string, port int, userName, password string, idRsa string) error {
86
87 if (instance.Connection == &ssh.Client{}) || instance.Connection == nil {
88
89 connection, err := connectionDial(host, port, userName, password, idRsa)
90
91 if err != nil {
92 return err
93 }
94
95 defer connection.Close()
96 }
97
98 return nil
99}
100
101// 判断端口是否可以(未被占用)
102func (instance *SSHRemote) IsPortAvailable(port int) bool {

Callers 3

GetWorkspaceFromCmdFunction · 0.95
reset.goFile · 0.80
host-add.goFile · 0.80

Calls 1

connectionDialFunction · 0.85

Tested by

no test coverage detected