1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-10 07:42:26 +08:00

fix: 为添加注释导致lint未通过

This commit is contained in:
voidint
2024-07-30 12:08:31 +08:00
parent 0bca4d5792
commit d3d35387b7

4
cache/redis.go vendored
View File

@@ -120,6 +120,7 @@ const (
PwdAuth SSHAuthMethod = 2 PwdAuth SSHAuthMethod = 2
) )
// OverSSH SSH 代理配置
type OverSSH struct { type OverSSH struct {
Host string `yml:"host" json:"host"` Host string `yml:"host" json:"host"`
Port int `yml:"port" json:"port"` Port int `yml:"port" json:"port"`
@@ -129,6 +130,7 @@ type OverSSH struct {
KeyFile string `yml:"key_file" json:"key_file"` KeyFile string `yml:"key_file" json:"key_file"`
} }
// DialWithPassword 返回密码方式认证的 SSH 客户端
func (s *OverSSH) DialWithPassword() (*ssh.Client, error) { func (s *OverSSH) DialWithPassword() (*ssh.Client, error) {
return ssh.Dial( return ssh.Dial(
"tcp", "tcp",
@@ -143,6 +145,7 @@ func (s *OverSSH) DialWithPassword() (*ssh.Client, error) {
) )
} }
// DialWithKeyFile 返回公钥方式认证的 SSH 客户端
func (s *OverSSH) DialWithKeyFile() (*ssh.Client, error) { func (s *OverSSH) DialWithKeyFile() (*ssh.Client, error) {
k, err := os.ReadFile(s.KeyFile) k, err := os.ReadFile(s.KeyFile)
if err != nil { if err != nil {
@@ -166,6 +169,7 @@ func (s *OverSSH) DialWithKeyFile() (*ssh.Client, error) {
) )
} }
// MakeDialer 创建 SSH 代理拨号器
func (s *OverSSH) MakeDialer() func(ctx context.Context, network, addr string) (net.Conn, error) { func (s *OverSSH) MakeDialer() func(ctx context.Context, network, addr string) (net.Conn, error) {
return func(ctx context.Context, network, addr string) (net.Conn, error) { return func(ctx context.Context, network, addr string) (net.Conn, error) {
var err error var err error