# README
redistimeseries-go
Go client for RedisTimeSeries (https://github.com/RedisTimeSeries/redistimeseries), based on redigo.
Client and ConnPool based on the work of dvirsky and mnunberg on https://github.com/RediSearch/redisearch-go
Installing
$ go get github.com/RedisTimeSeries/redistimeseries-go
Running tests
A simple test suite is provided, and can be run with:
$ go test
The tests expect a Redis server with the RedisTimeSeries module loaded to be available at localhost:6379
Example Code
package main
import (
"fmt"
redistimeseries "github.com/RedisTimeSeries/redistimeseries-go"
)
func main() {
// Connect to localhost with no password
var client = redistimeseries.NewClient("localhost:6379", "nohelp", nil)
var keyname = "mytest"
_, haveit := client.Info(keyname)
if haveit != nil {
client.CreateKeyWithOptions(keyname, redistimeseries.DefaultCreateOptions)
client.CreateKeyWithOptions(keyname+"_avg", redistimeseries.DefaultCreateOptions)
client.CreateRule(keyname, redistimeseries.AvgAggregation, 60, keyname+"_avg")
}
// Add sample with timestamp from server time and value 100
// TS.ADD mytest * 100
_, err := client.AddAutoTs(keyname, 100)
if err != nil {
fmt.Println("Error:", err)
}
}
Supported RedisTimeSeries Commands
License
redistimeseries-go is distributed under the Apache-2 license - see LICENSE
# Functions
Add counter args for command TS.INCRBY/TS.DECRBY.
Helper function to create a string pointer from a string literal.
NewClient creates a new client connecting to the redis host, and using the given name as key prefix.
NewClientFromPool creates a new Client with the given pool and client name.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
an error will occur for any out of order sample.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ignore the new value.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
override with latest value.
No description provided by the author
No description provided by the author
only override if the value is higher than the existing value.
No description provided by the author
No description provided by the author
only override if the value is lower than the existing value.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
MultiGetOptions are the default options for querying across multiple time-series.
MultiRangeOptions are the default options for querying across multiple time-series.
DefaultRangeOptions are the default options for querying across a time-series range.
# Structs
Client is an interface to time series redis commands.
CreateOptions are a direct mapping to the options provided when creating a new time-series Check https://oss.redislabs.com/redistimeseries/1.4/commands/#tscreate for a detailed description.
No description provided by the author
No description provided by the author
MultiGetOptions represent the options for querying across multiple time-series.
No description provided by the author
MultiRangeOptions represent the options for querying across multiple time-series.
No description provided by the author
MultiRangeOptions represent the options for querying across multiple time-series.
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author
# Type aliases
go:generate stringer -type=AggregationType.
go:generate stringer -type=DuplicatePolicyType.