Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-3058

Centralize x-package Connection interface as a struct

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Unknown Unknown
    • None
    • None
    • None
    • None

    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

      Attachments

        Activity

          People

            preston.vasquez@mongodb.com Preston Vasquez
            preston.vasquez@mongodb.com Preston Vasquez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: