Skip to content

Commit

Permalink
More scaffold.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Jul 1, 2024
1 parent d39b143 commit 634d775
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sources/mongo/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"go.mongodb.org/mongo-driver/mongo/options"
)

type collectionScanner struct {
type snapshot struct {
db *mongo.Database
cfg config.MongoDB
collection config.Collection
Expand All @@ -21,19 +21,19 @@ type collectionScanner struct {
done bool
}

func newSnapshotIterator(db *mongo.Database, collection config.Collection, cfg config.MongoDB) *collectionScanner {
return &collectionScanner{
func newSnapshotIterator(db *mongo.Database, collection config.Collection, cfg config.MongoDB) *snapshot {
return &snapshot{
db: db,
cfg: cfg,
collection: collection,
}
}

func (c *collectionScanner) HasNext() bool {
func (c *snapshot) HasNext() bool {
return !c.done
}

func (c *collectionScanner) Next() ([]lib.RawMessage, error) {
func (c *snapshot) Next() ([]lib.RawMessage, error) {
if !c.HasNext() {
return nil, fmt.Errorf("no more rows to scan")
}
Expand Down
3 changes: 3 additions & 0 deletions sources/mongo/streaming.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package mongo

type

0 comments on commit 634d775

Please sign in to comment.