model

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeEvent

type ChangeEvent struct {
	ID                bson.Raw  `bson:"_id" json:"_id"`
	OperationType     string    `bson:"operationType" json:"operationType"`
	FullDocument      bson.Raw  `bson:"fullDocument,omitempty" json:"fullDocument,omitempty"`
	Namespace         Namespace `bson:"ns" json:"ns"`
	To                Namespace `bson:"to,omitempty" json:"to,omitempty"`
	DocumentKey       bson.Raw  `bson:"documentKey,omitempty" json:"documentKey,omitempty"`
	UpdateDescription struct {
		UpdatedFields bson.M   `bson:"updatedFields,omitempty" json:"updatedFields,omitempty"`
		RemovedFields []string `bson:"removedFields,omitempty" json:"removedFields,omitempty"`
	} `bson:"updateDescription,omitempty" json:"updateDescription,omitempty"`
	ClusterTime       primitive.Timestamp `bson:"clusterTime" json:"clusterTime"`
	TransactionNumber int64               `bson:"txnNumber,omitempty" json:"txnNumber,omitempty"`
	SessionIdentifier bson.Raw            `bson:"lsid,omitempty" json:"lsid,omitempty"`
}

See https://docs.mongodb.com/manual/reference/change-events/

type Namespace

type Namespace struct {
	Database   string `bson:"db,omitempty" json:"db,omitempty"`
	Collection string `bson:"coll,omitempty" json:"coll,omitempty"`
}

type OpLog

type OpLog struct {
	OpTime        primitive.Timestamp `bson:"ts" json:"ts"`
	Hash          int64               `bson:"h" json:"h"`
	Version       int                 `bson:"v" json:"v"`
	OperationType string              `bson:"op" json:"op"`
	Namespace     string              `bson:"ns" json:"ns"`
	WallClockTime time.Time           `bson:"wall" json:"wall"`
	Operation     bson.Raw            `bson:"o" json:"o"`
	Update        bson.Raw            `bson:"o2,omitempty" json:"o2,omitempty"`
}

See https://docs.mongodb.com/manual/core/replica-set-oplog/

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL