Documentation
¶
Index ¶
- Constants
- Variables
- type GidOplogReader
- type OplogReader
- func (reader *OplogReader) GetQueryTimestamp() bson.MongoTimestamp
- func (reader *OplogReader) Next() (*bson.Raw, error)
- func (reader *OplogReader) NextOplog() (log *oplog.GenericOplog, err error)
- func (reader *OplogReader) SetQueryTimestampOnEmpty(ts bson.MongoTimestamp)
- func (reader *OplogReader) StartFetcher()
- func (reader *OplogReader) UpdateQueryTimestamp(ts bson.MongoTimestamp)
Constants ¶
View Source
const ( QueryTs = "ts" QueryGid = "g" QueryOpGT = "$gt" QueryOpGTE = "$gte" LocalDB = "local" )
View Source
const ( CollectionCapped = "CollectionScan died due to position in capped" // bigger than 3.0 CollectionCappedLowVersion = "UnknownError" // <= 3.0 version )
Variables ¶
View Source
var CollectionCappedError = errors.New("collection capped error")
View Source
var TimeoutError = errors.New("read next log timeout, It shouldn't be happen")
TimeoutError. mongodb query executed timeout
Functions ¶
This section is empty.
Types ¶
type GidOplogReader ¶
type GidOplogReader struct {
OplogReader
}
GidOplogReader. query along with gid
func NewGidOplogReader ¶
func NewGidOplogReader(src string) *GidOplogReader
func (*GidOplogReader) SetQueryGid ¶
func (reader *GidOplogReader) SetQueryGid(gid string)
type OplogReader ¶
type OplogReader struct {
// contains filtered or unexported fields
}
OplogReader represents stream reader from mongodb that specified by an url. And with query options. user can iterate oplogs.
func NewOplogReader ¶
func NewOplogReader(src, replset string) *OplogReader
NewOplogReader creates reader with mongodb url
func (*OplogReader) GetQueryTimestamp ¶
func (reader *OplogReader) GetQueryTimestamp() bson.MongoTimestamp
func (*OplogReader) Next ¶
func (reader *OplogReader) Next() (*bson.Raw, error)
Next returns an oplog by raw bytes which is []byte
func (*OplogReader) NextOplog ¶
func (reader *OplogReader) NextOplog() (log *oplog.GenericOplog, err error)
NextOplog returns an oplog by oplog.GenericOplog struct
func (*OplogReader) SetQueryTimestampOnEmpty ¶
func (reader *OplogReader) SetQueryTimestampOnEmpty(ts bson.MongoTimestamp)
SetQueryTimestampOnEmpty set internal timestamp if not exist in this reader. initial stage most of the time
func (*OplogReader) StartFetcher ¶
func (reader *OplogReader) StartFetcher()
start fetcher if not exist
func (*OplogReader) UpdateQueryTimestamp ¶
func (reader *OplogReader) UpdateQueryTimestamp(ts bson.MongoTimestamp)
Click to show internal directories.
Click to hide internal directories.