Skip to content

Commit

Permalink
added WithDialTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Apr 16, 2021
1 parent 116372e commit 5a4f8cb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/netrasp/netrasp.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package netrasp
import (
"errors"
"fmt"
"time"

"golang.org/x/crypto/ssh"
)
Expand Down Expand Up @@ -135,3 +136,10 @@ func WithSSHKeyExchange(name string) ConfigOpt {
c.SSHConfig.KeyExchanges = append(c.SSHConfig.KeyExchanges, name)
})
}

// WithDialTimeout allows you to configure timeout for dialing SSH server
func WithDialTimeout(t time.Duration) ConfigOpt {
return newFuncConfigOpt(func(c *config) {
c.SSHConfig.Timeout = t
})
}

0 comments on commit 5a4f8cb

Please sign in to comment.