Documentation ¶
Index ¶
Constants ¶
View Source
const ( StorageTypeAPI = "api" StorageTypeDB = "database" CheckpointDefaultDatabase = utils.AppDatabase CheckpointName = "name" MajorityWriteConcern = "majority" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type CheckpointContext ¶
type CheckpointContext struct { Name string `bson:"name" json:"name"` Timestamp bson.MongoTimestamp `bson:"ckpt" json:"ckpt"` }
type CheckpointManager ¶
type CheckpointManager struct { Type string // contains filtered or unexported fields }
func NewCheckpointManager ¶
func NewCheckpointManager(name string) *CheckpointManager
func (*CheckpointManager) Get ¶
func (manager *CheckpointManager) Get() *CheckpointContext
func (*CheckpointManager) GetInMemory ¶
func (manager *CheckpointManager) GetInMemory() *CheckpointContext
func (*CheckpointManager) Update ¶
func (manager *CheckpointManager) Update(ts bson.MongoTimestamp) error
type CheckpointOperation ¶
type CheckpointOperation interface { // read checkpoint from remote storage. and encapsulation // with CheckpointContext struct Get() *CheckpointContext // save checkpoint Insert(ckpt *CheckpointContext) error }
type HttpApiCheckpoint ¶
type HttpApiCheckpoint struct { Checkpoint URL string }
func (*HttpApiCheckpoint) Get ¶
func (ckpt *HttpApiCheckpoint) Get() *CheckpointContext
func (*HttpApiCheckpoint) Insert ¶
func (ckpt *HttpApiCheckpoint) Insert(insert *CheckpointContext) error
type MongoCheckpoint ¶
type MongoCheckpoint struct { Checkpoint Conn *dbpool.MongoConn QueryHandle *mgo.Collection // connection info URL string DB, Table string }
func (*MongoCheckpoint) Get ¶
func (ckpt *MongoCheckpoint) Get() *CheckpointContext
func (*MongoCheckpoint) Insert ¶
func (ckpt *MongoCheckpoint) Insert(updates *CheckpointContext) error
Click to show internal directories.
Click to hide internal directories.