Documentation ¶
Index ¶
- Constants
- Variables
- func CompareTimestamps(ts1, ts2 primitive.Timestamp) int
- func FromInt64(i int64) primitive.Timestamp
- func Int64ToUnixTimestampSeconds(ts int64) int64
- func IsZero(ts primitive.Timestamp) bool
- func ToDate(ts primitive.Timestamp) time.Time
- func ToInt64(ts primitive.Timestamp) int64
- type Checkpoint
- type CheckpointManager
- type MongoCheckpoint
- func (s *MongoCheckpoint) GetCheckpoint(ctx context.Context) (Checkpoint, error)
- func (s *MongoCheckpoint) MoveCheckpointForward(ts primitive.Timestamp)
- func (s *MongoCheckpoint) SetCheckpoint(ctx context.Context, ts primitive.Timestamp, save bool) error
- func (s *MongoCheckpoint) StartAutosave(context.Context)
- func (s *MongoCheckpoint) StopAutosave()
- type TsWindow
Constants ¶
View Source
const ( OplogCollection = "oplog.rs" OplogDatabase = "local" Newest = -1 Oldest = 1 )
Variables ¶
Functions ¶
func CompareTimestamps ¶
Types ¶
type Checkpoint ¶
type Checkpoint struct { //Id string `bson:"_id" json:"_id" omitempty` Name string `bson:"name" json:"name" omitempty` SavedAt time.Time `bson:"saved" json:"saved" omitempty` Latest time.Time `bson:"latest" json:"latest" omitempty` LatestTs primitive.Timestamp `bson:"ts" json:"ts" omitempty` LatestLSN int64 `bson:"lsn" json:"lsn" omitempty` }
type CheckpointManager ¶
type MongoCheckpoint ¶
type MongoCheckpoint struct { // Database used to store the checkpoint DB string // Collection used to store the checkpoint Collection string // In-memory storage of the current checkpoint Current Checkpoint // contains filtered or unexported fields }
func NewMongoCheckpointService ¶
func NewMongoCheckpointService(name string, ckptDb string, ckptColl string) *MongoCheckpoint
func (*MongoCheckpoint) GetCheckpoint ¶
func (s *MongoCheckpoint) GetCheckpoint(ctx context.Context) (Checkpoint, error)
func (*MongoCheckpoint) MoveCheckpointForward ¶ added in v0.0.13
func (s *MongoCheckpoint) MoveCheckpointForward(ts primitive.Timestamp)
func (*MongoCheckpoint) SetCheckpoint ¶
func (*MongoCheckpoint) StartAutosave ¶
func (s *MongoCheckpoint) StartAutosave(context.Context)
func (*MongoCheckpoint) StopAutosave ¶
func (s *MongoCheckpoint) StopAutosave()
Click to show internal directories.
Click to hide internal directories.