Skip to content

Commit d3d3538

Browse files
committed
fix: 为添加注释导致lint未通过
1 parent 0bca4d5 commit d3d3538

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cache/redis.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ const (
120120
PwdAuth SSHAuthMethod = 2
121121
)
122122

123+
// OverSSH SSH 代理配置
123124
type OverSSH struct {
124125
Host string `yml:"host" json:"host"`
125126
Port int `yml:"port" json:"port"`
@@ -129,6 +130,7 @@ type OverSSH struct {
129130
KeyFile string `yml:"key_file" json:"key_file"`
130131
}
131132

133+
// DialWithPassword 返回密码方式认证的 SSH 客户端
132134
func (s *OverSSH) DialWithPassword() (*ssh.Client, error) {
133135
return ssh.Dial(
134136
"tcp",
@@ -143,6 +145,7 @@ func (s *OverSSH) DialWithPassword() (*ssh.Client, error) {
143145
)
144146
}
145147

148+
// DialWithKeyFile 返回公钥方式认证的 SSH 客户端
146149
func (s *OverSSH) DialWithKeyFile() (*ssh.Client, error) {
147150
k, err := os.ReadFile(s.KeyFile)
148151
if err != nil {
@@ -166,6 +169,7 @@ func (s *OverSSH) DialWithKeyFile() (*ssh.Client, error) {
166169
)
167170
}
168171

172+
// MakeDialer 创建 SSH 代理拨号器
169173
func (s *OverSSH) MakeDialer() func(ctx context.Context, network, addr string) (net.Conn, error) {
170174
return func(ctx context.Context, network, addr string) (net.Conn, error) {
171175
var err error

0 commit comments

Comments
 (0)