Go implementation of the server-client solution for storing key-value data.
- make
- docker
Note: in order to run docker commands in the makefile targets without sudo you have to follow the next guide.
If you have go tool installed:
- get source files:
go get github.com/SiarheiKresik/go-kvdb cd $GOPATH/src/github.com/SiarheiKresik/go-kvdb
Or get source files by cloning repository directly:
- get source files:
git clone https://github.com/SiarheiKresik/go-kvdb.git cd go-kvdb
Run make. This builds the go-kvdb docker container with the server and client binaries.
Run server in a docker container:
make run [ARGS="<args>"]ordocker run --rm -p 9090:9090 go-kvdb:latest [ARG...]
Run client in a docker container:
make run-client [ARGS="<args>"]ordocker run --rm -it --entrypoint /app/client go-kvdb:latest [ARG...]
make check—runs code linting and verificationmake test—runs tests for the project filesmake coverage—measures test coverage, saves result to thecoverage.outfile
Starting options:
-m,--modeThe possible storage option (disk—stores database to disk, memory—database runs only in memory)-p,--portThe port for listening on (default—9090)
Starting options:
-p,--portThe port to connect to the server (default—9090)-h,--hostThe host to connect to the server (default—127.0.0.1)
- SET - updates a key at a time with the given value
- GET - returns the value of a key
- DEL - removes a key
- KEYS - returns all keys matching pattern; pattern could include '*' symbol which matches zero or more characters