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

Don't use "*Context" types to configure BSON "Encoder" or "Decoder"

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Unknown Unknown
    • 2.0.0
    • None
    • BSON
    • None
    • Major Change

    Description

      The APIs that accept EncodeContext and DecodeContext create a lot of unnecessary duplication in the bson package API. For example, there are currently multiple ways to configure a bson.Encoder or bson.Decoder:

      • Set a Registry directly on the Encoder via SetRegistry.
      • Set a Registry in an EncodeContext via SetContext.

      Remove all bson APIs that accept an EncodeContext or DecodeContext for configuring a Encoder or Decoder. Keep the EncodeContext and DecodeContext in the ValueEncoder and ValueDecoder APIs.

      Definition of done:

      • Remove all bson APIs that accept an EncodeContext or DecodeContext for configuring a Encoder or Decoder.
      • Add functions to the bson.Encoder API to replace all behaviors configurable via a bson.EncodeContext.
      • Add functions to the bson.Decoder API to replace all behaviors configurable via a bson.DecodeContext.

      Attachments

        Activity

          People

            Unassigned Unassigned
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: