mirror of
https://github.com/tnb-labs/panel.git
synced 2026-09-01 14:55:12 +08:00
chore: 清理代码
This commit is contained in:
@@ -24,27 +24,6 @@ type ClientConfig struct {
|
||||
Timeout time.Duration `json:"timeout"`
|
||||
}
|
||||
|
||||
func ClientConfigPassword(host, user, password string) *ClientConfig {
|
||||
return &ClientConfig{
|
||||
Timeout: 10 * time.Second,
|
||||
AuthMethod: PASSWORD,
|
||||
Host: host,
|
||||
User: user,
|
||||
Password: password,
|
||||
}
|
||||
}
|
||||
|
||||
func ClientConfigPublicKey(host, user, key, passphrase string) *ClientConfig {
|
||||
return &ClientConfig{
|
||||
Timeout: 10 * time.Second,
|
||||
AuthMethod: PUBLICKEY,
|
||||
Host: host,
|
||||
User: user,
|
||||
Key: key,
|
||||
Passphrase: passphrase,
|
||||
}
|
||||
}
|
||||
|
||||
func NewSSHClient(conf ClientConfig) (*ssh.Client, error) {
|
||||
if conf.Timeout == 0 {
|
||||
conf.Timeout = 10 * time.Second
|
||||
|
||||
Reference in New Issue
Block a user