Skip to content

Commit c56f978

Browse files
committed
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 6ba01ff commit c56f978

File tree

6 files changed

+549
-141
lines changed

6 files changed

+549
-141
lines changed

CHANGELOG.md

+5
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

+3-1
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)