[GODRIVER-3058] Centralize x-package Connection interface as a struct Created: 27/Nov/23  Updated: 28/Nov/23

Status: In Code Review
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Unknown
Reporter: Preston Vasquez Assignee: Preston Vasquez
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by GODRIVER-2965 Make the "description" package internal Blocked
Epic Link: Go Driver 2.0: Driver
Quarter: FY24Q3, FY24Q4

 Description   

Context

The driver.Connection interface is returned by various functions with the x package, which is a pattern in conflict with the Go idiom of "accept interfaces, return structs" defined in the wiki: https://github.com/golang/go/wiki/CodeReviewComments#interfaces . And generally violates the robustness principle: https://en.m.wikipedia.org/wiki/Robustness_principle

Furthermore, this pattern makes migrating the description package to the internal package difficult since the connection interface has a dependency on the description package. 

Definition of done

We should centralize the connection object as a struct in a one-off package in the x/mongo/driver director. This was we can take an experimental subset of the server object as the description.

Pitfalls

Unknown


Generated at Thu Feb 08 08:39:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.