2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 11:27:17 +08:00

chore: fix lint

This commit is contained in:
耗子
2024-05-30 02:27:35 +08:00
parent 73cc5a35ad
commit 76e992cc9e
8 changed files with 73 additions and 60 deletions

View File

@@ -15,7 +15,7 @@ const (
PUBLICKEY
)
type SSHClientConfig struct {
type ClientConfig struct {
AuthMethod AuthMethod
HostAddr string
User string
@@ -24,8 +24,8 @@ type SSHClientConfig struct {
Timeout time.Duration
}
func SSHClientConfigPassword(hostAddr, user, Password string) *SSHClientConfig {
return &SSHClientConfig{
func ClientConfigPassword(hostAddr, user, Password string) *ClientConfig {
return &ClientConfig{
Timeout: time.Second * 5,
AuthMethod: PASSWORD,
HostAddr: hostAddr,
@@ -34,8 +34,8 @@ func SSHClientConfigPassword(hostAddr, user, Password string) *SSHClientConfig {
}
}
func SSHClientConfigPulicKey(hostAddr, user, keyPath string) *SSHClientConfig {
return &SSHClientConfig{
func ClientConfigPublicKey(hostAddr, user, keyPath string) *ClientConfig {
return &ClientConfig{
Timeout: time.Second * 5,
AuthMethod: PUBLICKEY,
HostAddr: hostAddr,
@@ -44,7 +44,7 @@ func SSHClientConfigPulicKey(hostAddr, user, keyPath string) *SSHClientConfig {
}
}
func NewSSHClient(conf *SSHClientConfig) (*ssh.Client, error) {
func NewSSHClient(conf *ClientConfig) (*ssh.Client, error) {
config := &ssh.ClientConfig{
Timeout: conf.Timeout,
User: conf.User,