Skip to content

Commit 54a3a4b

Browse files
authoredMay 11, 2022
Merge pull request #1082 from johanneswuerbach/connector-dialer
feat: change the connector dialer
2 parents 30d9faf + cf6aeee commit 54a3a4b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎conn.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ func DialOpen(d Dialer, dsn string) (_ driver.Conn, err error) {
322322
if err != nil {
323323
return nil, err
324324
}
325-
c.dialer = d
325+
c.Dialer(d)
326326
return c.open(context.Background())
327327
}
328328

‎connector.go

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ func (c *Connector) Connect(ctx context.Context) (driver.Conn, error) {
2727
return c.open(ctx)
2828
}
2929

30+
// Dialer allows change the dialer used to open connections.
31+
func (c *Connector) Dialer(dialer Dialer) {
32+
c.dialer = dialer
33+
}
34+
3035
// Driver returns the underlying driver of this Connector.
3136
func (c *Connector) Driver() driver.Driver {
3237
return &Driver{}

0 commit comments

Comments
 (0)
Please sign in to comment.