[GODRIVER-759] Make Cursor a struct and make changeStream public Created: 09/Jan/19 Updated: 28/Oct/23 Resolved: 01/Feb/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 0.3.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kristofer Brandow (Inactive) | Assignee: | Kristofer Brandow (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
In Go, it is idiomatic for the consumers of an interface to declare the type, not the implementer. There is an exception for interfaces that have multiple implementations in the same package, but generally, this rule should be followed. For this reason, the Cursor type should be redefined as a struct instead of an interface. Additionally, since the cursor returned from Watch will require a new method that will not be on Cursor the changeStream type should be made public and be returned from Watch.
https://github.com/golang/go/wiki/CodeReviewComments#interfaces |
| Comments |
| Comment by Githook User [ 01/Feb/19 ] |
|
Author: {'name': 'Kris Brandow', 'email': 'kris@mongodb.com', 'username': 'skriptble'}Message: Fix cursor types and implement BatchCursor
Change-Id: I7d4121e7fffcfadd7427a6fc64d97d4c131acbbe |
| Comment by Kristofer Brandow (Inactive) [ 22/Jan/19 ] |
|
Code Review: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/441591. |