reader

package
v0.0.0-...-6e85931 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MONGO_DB_NAME    string = "local"
	MONGO_COLLECTION string = "oplog.rs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileReader

type FileReader struct {
	FilePath string
}

FileReader implements the OplogReader interface for reading Oplog entries from a file.

func (*FileReader) ReadOplogs

func (fr *FileReader) ReadOplogs(ctx context.Context, publisher domain.OplogPublisher) error

ReadOplogs reads Oplog entries from the file and publish them in the publisher.

type MongoReader

type MongoReader struct {
	ConnectionString string
}

MongoReader implements the OplogReader interface for reading Oplog entries from a running MongoDB instance.

func (*MongoReader) ReadOplogs

func (mr *MongoReader) ReadOplogs(ctx context.Context, publisher domain.OplogPublisher) error

ReadOplogs reads Oplog entries from the file and publish them in the publisher.

type OplogReader

type OplogReader interface {
	ReadOplogs(ctx context.Context, publisher domain.OplogPublisher) error
}

OplogReader defines the interface for reading Oplog entries and storing them in the publisher.

func NewFileReader

func NewFileReader(filePath string) OplogReader

NewFileReader creates a new instance of FileReader.

func NewMongoReader

func NewMongoReader(connectionStr string) OplogReader

NewMongoReader creates a new instance of FileReader.

Jump to

Keyboard shortcuts

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