TinyRedis is a very lightweight app, divided into two parts, TinyRedisServer & TinyRedisClient, which work together just like Redis, but only with 4 commands: SET, GET, DEL and EXIT.
In order to launch the program, it's ought to do the following steps: Get the app via following commands:
git clone https://github.com/corvustristis/GoHomework
cd GoHomeworkTo do it, you have to install Go compiler. Then proceed to the following steps:
- Launch TinyRedisServer from the folder of the same name:
./TinyRedisServerThere are options -p or --port for the choice of port and options -m or --mode for the choice of port.
- Launch TinyRedisClient from another folder:
./TinyRedisClientIf you had chosen a port of your preferences in a previous step, don't forget to use it here as well. Optionally you can launch multiple clients at the same time, though you would be doing it at your own risk.
To proceed, you must have Docker installed. After that proceed to the following steps:
- The project is already built and checked, but just in case you can delete binaries, compile them again, or check the code with
gofmtandgo vet, run some of the the following lines:
make clean build check- Build the project with:
make tinyredis- Launch server:
docker run -p 9090:9090 --name tinyredis tinyredisThere are options -p or --port for the choice of port and options -m or --mode for the choice of port. For example, if you have chosen custom port 3333, launch server via following:
docker run -p 3333:9090 --name tinyredis tinyredis --port=3333If you have already lauched the container at least once, and there is a name conflict, do this:
make cleancontainer- Launch bash for TinyRedisClient:
docker exec -it tinyredis bash- Finally, lauch the client itself:
./src/TinyRedis/TinyRedisClient/TinyRedisClientDon't forget about your custom port here!
Thought test files are stored in each folder separately, you can test the code via following instruction right from the main folder:
make testAfter it, the browser with test data will open, and you would be able to choose either server, or client coverage.