Task definition taken from here
Simple implementation of Redis-like in-memory cache
Desired features:
- Key-value storage with string, lists, dict support
- Per-key TTL
- Operations:
- Get
- Set
- Remove
- Golang API client
- Provide some tests, API spec, some deployment manual, some examples of client usages would be nice.
Optional features:
- Telnet-like/HTTP-like API protocol
- performance tests
- Operations:
- Keys
./gradlew goBuild
Result binaries will be placed into ./gogradle
folder
docker build -t apunko/go-cache .
On Linux OS:
./.gogradle/linux_amd64_go-cache
On Win OS:
./.gogradle/windows_amd64_go-cache.exe
On Linux OS:
./.gogradle/linux_amd64_go-cache 8005
On Win OS:
./.gogradle/windows_amd64_go-cache.exe 8005
docker run --rm -p 8000:8000 apunko/go-cache
docker-compose up
curl -i -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d '{"value": "Ivan", "ttl": 60000000000}' http://localhost:8000/items/name
curl -i -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d '{"value": ["VISA", "Mastercard"], "ttl": 60000000000}' http://localhost:8000/items/cards
curl -i -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d '{"value": {"Math": "9", "English": "7"}, "ttl": 60000000000}' http://localhost:8000/items/marks
curl -i http://localhost:8000/items/name
curl -i http://localhost:8000/items/keys
curl -i -X DELETE http://localhost:8000/items/name
curl -i -X DELETE http://localhost:8000/items/keys