



Populate Redis
Golang tool to feed redis database with fake users data for testing purposes.
Source code analysed with DeepSource
Summary
Prerequisites
Setup redis database
- Pull redis docker image
docker pull redis
- Launch redis database
docker run --name redis -p 6479:6379 -d redis
- Test the connection
redis-cli -p 6479
You can also use Redis Insight
Installing Go dependencies
In order to install the dependencies, you should run go get once you've pulled
this project
How to use
Using go run . --help will display the list of arguments that you can give to
this script
-n int Number of users to generate (default 10)
-v Make the process verbose or not
Note: Boolean arguments (-v and -f) will be set to true if they are
provided, there is no need to give them a value like : -v true.
Example :
go run . -f -n 10
Will enable the flush feature, but keep the verbose feature disabled
How to run
You can run this script with go run . [args]
Flush parameter
The flush parameter will prompt you with the following message before actually
flushing the database, and display the current database it is looking to flush.
2021/04/08 15:46:49 Are you SURE you want to flush this database ? localhost:6379 [y/n]:
If you decide not to flush the database, it will still go on to generate users.
You can always interrupt the process with Ctrl+C at this step if you do not
want to generate users.
Unit tests
To launch unit tests
go test ./...
To make a pull request: https://github.com/LucasNoga/redis-populate/pulls
To summon an issue: https://github.com/LucasNoga/redis-populate/issues
For any specific demand by mail: luc4snoga@gmail.com
Credits
Made by Lucas Noga.
Licensed under GPLv3.