Fast RESP 3 protocol reader and writer for Go.
This is a small package that provides fast reader and writer types for version 3 of the REdis Serialization Protocol (short RESP).
go get -u github.com/nussjustin/resp3
To run all unit tests, just call go test
:
go test
If you want to run integration tests you need to pass the integration
tag to go test
:
go test -tags integration
By default integration tests will try to connect to a Redis instance on 127.0.0.1:6379
.
If your instance has a non-default config, you can use the REDIS_HOST
environment variable, to override the address:
REDIS_HOST=127.0.0.1:6380 go test -tags integration # different port
REDIS_HOST=192.168.0.1:6380 go test -tags integration # different host
REDIS_HOST=/tmp/redis.sock go test -tags integration # unix socket
Note: If you want to test using a unix socket, make sure that the path to the socket starts with a slash,
for example /tmp/redis.sock
.
Debug logging for integration tests can be enabled by passing the -debug
flag to go test
.
Justin Nuß – @nussjustin
Distributed under the MIT license. See LICENSE
for more information.
- Fork it (https://github.com/nussjustin/resp3/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request