Skip to content

gemography/redimo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redimo

Go Report Card

An Open-Source Utility for Mongo-Redis Synchronization using Change Streams

Description

redimo is a utility that synchronizes mongodb and redis using change streams. It can be used also in case of failure of mongodb instances.

Structure

config
  config.go
handlers
  userHandler.go
models
  changeDocument.go
  dataStore.go
  user.go
utils
  mongo.go
  redis.go
app.go

To add new handlers of new collections. You should create your model under models and your handler under handlers. For more information about creating handlers for new collections please check the Wiki.

Installation

By Cloning the repository

$ git clone https://github.com/hiddenfounders/redimo.git

$ cd redimo

By go get

$ go get github.com/hiddenfounders/redimo

Then go to your $GOPATH/src/github.com/hiddenfounders/redimo

Configuration

The general config file is at config/config.go, if you do not use username and password, just let it empty.

Mongo configuration is at utils/mongo.go. If you are using a database with authentication, please make the boolean withPassword = true and add the credentials to config/config.go.

Redis configuration is at utils/redis.go.

Run the application

$ go run app.go

$ go build app.go && ./app

Development

If you want to add another handler, add the model to models and follow the template used in userHandler.go to make your own handler.

The function ListenOnPipeline() is generic and it can be called for any model.

Wiki

[redis for golang] https://godoc.org/github.com/go-redis/redis

[mongo for golang] https://github.com/globalsign/mgo

About

An Open-Source Utility for Mongo-Redis Synchronization using Change Streams

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages