forked from mongodb/mongo-go-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement base driver.Connection type
Implements the topology.connection and topology.Connection types. GODRIVER-930 Change-Id: If3c133b754028b8e832aa198b285593f6f2efbfc
- Loading branch information
Showing
11 changed files
with
958 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Topology Package Design | ||
This document outlines the design for this package. | ||
|
||
## Connection | ||
Connections are handled by two main types and an auxiliary type. The two main types are `connection` | ||
and `Connection`. The first holds most of the logic required to actually read and write wire | ||
messages. Instances can be created with the `newConnection` method. Inside the `newConnection` | ||
method the auxiliary type, `initConnection` is used to perform the connection handshake. This is | ||
required because the `connection` type does not fully implement `driver.Connection` which is | ||
required during handshaking. The `Connection` type is what is actually returned to a consumer of the | ||
`topology` package. This type does implement the `driver.Connection` type, holds a reference to a | ||
`connection` instance, and exists mainly to prevent accidental continued usage of a connection after | ||
closing it. | ||
|
||
The connection implementations in this package are conduits for wire messages but they have no | ||
ability to encode, decode, or validate wire messages. That must be handled by consumers. |
Oops, something went wrong.