[GODRIVER-162] Design and write first-draft of bson.Decoder Created: 14/Dec/17  Updated: 28/Oct/23  Resolved: 29/Jan/18

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 0.0.1

Type: New Feature Priority: Major - P3
Reporter: Kristofer Brandow (Inactive) Assignee: Samuel Rossi (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by GODRIVER-178 Add testing for bson.Decoder Closed
Epic Link: GODRIVER New BSON

 Description   

The bson.Decoder is responsible for decoding an io.Reader into the provided type.

The steps are as follows:

  1. Read a full document into a slice of bytes
  2. Determine if the provided type implements the bson.Unmarshaler interface, if it does call the UnmarshalBSON method and we're done
  3. Reflect the type and determine the keys that will be filled in, using the struct name and available tags
  4. Iterate over the available elements and fill in the provided type. For any interface{} values encountered, place a *ReaderElement in that spot.

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