Documentation
¶
Index ¶
- Constants
- Variables
- func BsonTimestampFromOplogTS(ots Timestamp) primitive.Timestamp
- func LessTS(ots1, ots2 Timestamp) bool
- func NewError(code ErrorCode, msg string) error
- type Archive
- type Error
- type ErrorCode
- type IsMaster
- type IsMasterLastWrite
- type OpTime
- type Oplog
- type OplogMeta
- type Timestamp
Constants ¶
View Source
const ( OplogArchBasePath = "oplog_" + utility.VersionStr + "/" ArchNameTSDelimiter = "_" ArchiveTypeOplog = "oplog" ArchiveTypeGap = "gap" )
Archive path constants
Variables ¶
View Source
var (
ArchRegexp = regexp.MustCompile(`^(oplog|gap)_(?P<startTS>[0-9]+\.[0-9]+)_(?P<endTS>[0-9]+\.[0-9]+)\.(?P<Ext>[^$]+)$`)
)
View Source
var ErrorDescriptions = map[ErrorCode]string{ SplitFound: "last known document was not found", VersionChanged: "schema version of the user credential documents changed", CollectionRenamed: "collection renamed", }
ErrorDescriptions maps error codes to messages
Functions ¶
func BsonTimestampFromOplogTS ¶
BsonTimestampFromOplogTS builds BSON primitive from Timestamp
Types ¶
type Archive ¶
Archive defines oplog archive representation
func ArchFromFilename ¶
ArchFromFilename builds Arch from given path TODO: support empty extension
func NewArchive ¶
NewArchive builds Archive struct with given arguments
type IsMasterLastWrite ¶
IsMasterLastWrite ...
type Oplog ¶
type Oplog struct {
TS Timestamp `bson:"ts"`
OP string `bson:"op"`
NS string `bson:"ns"`
Data []byte
}
Oplog represents oplog raw and parsed metadata.
func OplogFromRaw ¶
OplogFromRaw tries to decode bytes to Oplog model
type OplogMeta ¶
type OplogMeta struct {
TS primitive.Timestamp `bson:"ts"`
NS string `bson:"ns"`
Op string `bson:"op"`
}
OplogMeta is used to decode raw bson record.
type Timestamp ¶
Timestamp represents oplog record uniq id.
func TimestampFromBson ¶
TimestampFromBson builds Timestamp from BSON primitive
func TimestampFromStr ¶
TimestampFromStr builds Timestamp from string
Click to show internal directories.
Click to hide internal directories.