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
Click to show internal directories.
Click to hide internal directories.