[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

GODRIVER-3
GODRIVER-759
GODRIVER-791

Change-Id: I7d4121e7fffcfadd7427a6fc64d97d4c131acbbe
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/d23c3a5ccaad4abaa2056f0ba9d174f0b06ccddf

Comment by Kristofer Brandow (Inactive) [ 22/Jan/19 ]

Code Review: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/441591.

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