db

package
v0.0.0-...-735958a Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyOpsResponse

type ApplyOpsResponse struct {
	Ok     bool   `bson:"ok"`
	ErrMsg string `bson:"errmsg"`
}

type Config

type Config struct {
	URI         string
	SSL         bool
	Creds       mgo.Credential
	Database    string
	Collections []string
}

func (*Config) Load

func (p *Config) Load() error

type Connection

type Connection struct {
	Session   *mgo.Session
	OplogChan chan bson.M
	Mutex     sync.Mutex
	Optime    bson.MongoTimestamp
	NOplog    uint64
	NDone     uint64
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(config Config) (*Connection, error)

func (*Connection) Databases

func (c *Connection) Databases() ([]string, error)

func (*Connection) Push

func (c *Connection) Push(oplog bson.M)

func (*Connection) SyncOplog

func (c *Connection) SyncOplog(dst *Connection) error

type Oplog

type Oplog struct {
	Timestamp bson.MongoTimestamp `bson:"ts"`
	HistoryID int64               `bson:"h"`
	Version   int                 `bson:"v"`
	Operation string              `bson:"op"`
	Namespace string              `bson:"ns"`
	Object    bson.D              `bson:"o"`
	Query     bson.D              `bson:"o2"`
}

Jump to

Keyboard shortcuts

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