populate-redis

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

README

Redis-Populate CI Version Total views

GitHub watchers GitHub forks GitHub Repo stars GitHub repo size GitHub language count GitHub top language
GitHub commit activity (branch) GitHub issues GitHub closed issues GitHub All Contributors

Go

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
  1. Pull redis docker image
docker pull redis
  1. Launch redis database
docker run --name redis -p 6479:6379 -d redis
  1. 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 ./...

Contact

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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