mongodb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadgerItrToJSON

func BadgerItrToJSON(itr *badger.Iterator) []byte

Takes a badgerDB iterator pointer and returns its key's value formatted as a JSON

func SimplifyMap

func SimplifyMap(docMap *map[string]interface{})

Takes a map[string] interface {} and converts values into easier to read formats. Additionally adds a "Time" field with the current time for update purposes.

Types

type SyncingService

type SyncingService struct {
	// DB Holds a pointer to the global badgerDB database
	DB *badger.DB
	// SyncDBURI holds a string URI path for connecting to the running mongoDB server
	SyncDBURI string
	// contains filtered or unexported fields
}

func NewSyncingService

func NewSyncingService(db *badger.DB, syncDBURI string, mongoDBName string, mongoCollectionName string) *SyncingService

Initializes and returns a new SyncingService Structure with a nil mongo client

func (*SyncingService) ConnectToMongo

func (syncSrv *SyncingService) ConnectToMongo()

Establishes and returns a MongoDB client with associated URI MongoDbURI

func (*SyncingService) DisconnectFromMongo

func (syncSrv *SyncingService) DisconnectFromMongo()

Disconnects from MongoDB Client client

func (*SyncingService) Start

func (syncSrv *SyncingService) Start()

Starts syncing badgerDB data to mongoDB client

Jump to

Keyboard shortcuts

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