RedisTS is a typesafe Go client for RedisTimeSeries.
RedisTimeSeries documentation: https://oss.redis.com/redistimeseries/commands/
This library tries to support multiple Redis clients, because applications probably already use one. There are examples in the reference for github.com/go-redis/redis/v8
, github.com/gomodule/redigo
, github.com/joomcode/redispipe
, and github.com/mediocregopher/radix/v4
demonstrating how one can create a new RedisTS client using them.
RedisTS was created during a coding spree which had the following focus:
- Functional options for friendly APIs.
- Type safety.
- Switched word order for better autocompletion and to follow the naming scheme used in stdlib (e.g.
http.MethodGet
,http.StatusNotFound
). - Compatibility with multiple Redis clients.
- Accept
time.Time
andtime.Duration
where a parameter is a timestamp in milliseconds or a duration in milliseconds.
go get -u github.com/coding-socks/redists
go test
The tests expect a Redis server with RedisTimeSeries ^v1.6
module to be available at localhost:6379
. One can use -test.short
to skip those tests.
go test -test.short
Below you can find an example code to run a Redis server with "edge" version of RedisTimeSeries via docker.
docker run --name dev-redists -p 6379:6379 -d redislabs/redistimeseries:edge
RedisTS is tested with the following clients:
github.com/go-redis/redis/v8
github.com/gomodule/redigo
github.com/joomcode/redispipe
github.com/mediocregopher/radix/v4
It probably works with others, but it's not guaranteed. Feel free to open an issue to get support for other clients, because if it isn't too much effort it will be added to the list above.
This project is still in alpha phase. In this stage the public API can change multiple times a day.
Beta version will be considered when the feature set covers the documents the implementation is based on, and the public API reaches a mature state.
Any type of contribution is welcome; from features, bug fixes, documentation improvements, feedbacks, questions. While GitHub uses the word "issue" feel free to open up a GitHub issue for any of these.
RedisTS is distributed under the MIT license.