Versions in this module Expand all Collapse all v0 v0.2.23 May 14, 2021 Changes in this version + var OplogAppModes = map[OplogAppMode]struct + func WaitForBecomePrimary(ctx context.Context, mc *MongoClient, checkTimeout time.Duration) error + type ApplyOplog struct + LSID bson.Raw + Namespace string + Object bson.D + Operation string + PrevOpTime bson.Raw + Query bson.D + TxnNumber *int64 + UI *primitive.Binary + type BsonCursor struct + func NewBsonCursor(r io.Reader) *BsonCursor + func (b *BsonCursor) Close(ctx context.Context) error + func (b *BsonCursor) Data() []byte + func (b *BsonCursor) Err() error + func (b *BsonCursor) Next(ctx context.Context) bool + func (b *BsonCursor) Push(data []byte) error + type CmdResponse struct + ErrMsg string + Ok int + type IndexDocument struct + Key bson.D + Options bson.M + PartialFilterExpression bson.D + type IsMaster struct + IsMaster bool + LastWrite IsMasterLastWrite + type IsMasterLastWrite struct + MajorityOpTime OpTime + OpTime OpTime + type MongoClient struct + func NewMongoClient(ctx context.Context, uri string, setters ...Option) (*MongoClient, error) + func (mc *MongoClient) ApplyOp(ctx context.Context, dbop db.Oplog) error + func (mc *MongoClient) Close(ctx context.Context) error + func (mc *MongoClient) CreateIndexes(ctx context.Context, dbName, collName string, indexes []IndexDocument) error + func (mc *MongoClient) EnsureIsMaster(ctx context.Context) error + func (mc *MongoClient) IsMaster(ctx context.Context) (models.IsMaster, error) + func (mc *MongoClient) LastWriteTS(ctx context.Context) (lastTS, lastMajTS models.Timestamp, err error) + func (mc *MongoClient) TailOplogFrom(ctx context.Context, from models.Timestamp) (OplogCursor, error) + type MongoDriver interface + ApplyOp func(ctx context.Context, op db.Oplog) error + Close func(ctx context.Context) error + CreateIndexes func(ctx context.Context, dbName, collName string, indexes []IndexDocument) error + EnsureIsMaster func(ctx context.Context) error + IsMaster func(ctx context.Context) (models.IsMaster, error) + LastWriteTS func(ctx context.Context) (lastTS, lastMajTS models.Timestamp, err error) + TailOplogFrom func(ctx context.Context, from models.Timestamp) (OplogCursor, error) + type MongoOplogCursor struct + func NewMongoOplogCursor(c *mongo.Cursor) *MongoOplogCursor + func (m *MongoOplogCursor) Data() []byte + func (m *MongoOplogCursor) Next(ctx context.Context) bool + func (m *MongoOplogCursor) Push(data []byte) error + type OpTime struct + TS primitive.Timestamp + Term int64 + type OplogAppMode string + const OplogAppModeInitSync + const OplogAppModeRecovering + const OplogAppModeSecondary + type OplogCursor interface + Close func(ctx context.Context) error + Data func() []byte + Err func() error + Next func(context.Context) bool + Push func([]byte) error + type Option func(*Options) + func OplogAlwaysUpsert(alwaysUpsert bool) Option + func OplogApplicationMode(mode OplogAppMode) Option + type Options struct + OplogAlwaysUpsert *bool + OplogApplicationMode *OplogAppMode