Skip to content

Commit e765b0a

Browse files
DerekBumoleg-jukovec
authored andcommitted
api: add helper Dialer implementations
To disable SSL by default we want to transfer `OpenSslDialer` to the go-openssl repository. In order to do so, we need to minimize the amount of copy-paste of the private functions. `AuthDialer` is created as a dialer-wrapper, that calls authentication methods. `ProtoDialer` is created to receive and check the `ProtocolInfo` in the created connection. `GreetingDialer` is created to fill the `Greeting` in the created connection. Part of #301
1 parent f02579a commit e765b0a

File tree

6 files changed

+549
-141
lines changed

6 files changed

+549
-141
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
3737
the response (#237)
3838
- Ability to mock connections for tests (#237). Added new types `MockDoer`,
3939
`MockRequest` to `test_helpers`.
40+
- `AuthDialer` type for creating a dialer with authentication (#301)
41+
- `ProtocolDialer` type for creating a dialer with `ProtocolInfo` receiving and
42+
check (#301)
43+
- `GreetingDialer` type for creating a dialer, that fills `Greeting` of a
44+
connection (#301)
4045

4146
### Changed
4247

connection.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,9 @@ func (conn *Connection) dial(ctx context.Context) error {
440440
}
441441

442442
conn.addr = c.Addr()
443-
conn.Greeting.Version = c.Greeting().Version
443+
connGreeting := c.Greeting()
444+
conn.Greeting.Version = connGreeting.Version
445+
conn.Greeting.Salt = connGreeting.Salt
444446
conn.serverProtocolInfo = c.ProtocolInfo()
445447

446448
spaceAndIndexNamesSupported :=

0 commit comments

Comments
 (0)