[GODRIVER-1680] Add typeDecoder interface and dedicated bson.D decoder Created: 10/Jul/20 Updated: 28/Oct/23 Resolved: 13/Jul/20 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | 1.5.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Divjot Arora (Inactive) | Assignee: | Divjot Arora (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Epic Link: | GODRIVER-1587 | ||||||||||||
| Description |
|
Introduce an unexported typeDecoder interface to bsoncodec:
Also add a decodeAdapter type that contains both a typeDecoder and ValueDecoder which can be added to a Registry. Modify EmptyInterfaceCodec to implement both typeDecoder and ValueDecoder. When delegating to another codec, it should delegate to typeDecoder if possible and fallback to ValueDecoder if not. Add a dedicated bson.D decoder which delegates to the typeDecoder for interface{} if it exists (which it should in the default case) and falls back to ValueDecoder if not (e.g. if the decoder for interface{} has been overriden). |
| Comments |
| Comment by Githook User [ 13/Jul/20 ] |
|
Author: {'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}Message: Co-authored-by: David Bartley <bartle@stripe.com> |
| Comment by Divjot Arora (Inactive) [ 10/Jul/20 ] |