...

Source file src/go.mongodb.org/mongo-driver/mongo/integration/unified/cursor_entity.go

Documentation: go.mongodb.org/mongo-driver/mongo/integration/unified

     1  // Copyright (C) MongoDB, Inc. 2017-present.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License"); you may
     4  // not use this file except in compliance with the License. You may obtain
     5  // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
     6  
     7  package unified
     8  
     9  import (
    10  	"context"
    11  )
    12  
    13  // The cursor interface defines the methods that must be implemented by iterable types that can be stored in an
    14  // EntityMap. This type exists so that we can store multiple concrete types returned by functions from the mongo package
    15  // under a single interface (e.g. mongo.Cursor and mongo.ChangeStream).
    16  type cursor interface {
    17  	Close(context.Context) error
    18  	Decode(interface{}) error
    19  	Err() error
    20  	Next(context.Context) bool
    21  	TryNext(context.Context) bool
    22  }
    23  

View as plain text