/tair-go

A client packaged based on go-redis that operates Tair For Redis Modules.

Primary LanguageGoMIT LicenseMIT

tair-go

build workflow Go Reference

English | 简体中文

A client packaged based on go-redis that operates Tair For Redis Modules.

  • TairString, is a string that contains s version number.(Open sourced)
  • TairHash, is a hash that allows you to specify the expiration time and verison number of a field.(Open sourced)
  • TairZset, allows you to sort data of the double type based on multiple dimensions. (Open sourced)
  • TairBloom, is a Bloom filter that supports dynamic scaling. (Coming soon)
  • TairRoaring, is a more efficient and balanced type of compressed bitmaps recognized by the industry. (Coming soon)
  • TairSearch, is a full-text search module developed in-house based on Redis modules. (Coming soon)
  • TairDoc, to perform create, read, update, and delete (CRUD) operations on JSON data. (Coming soon)
  • TairGis, allowing you to query points, linestrings, and polygons. (Coming soon)
  • TairTs, is a time series data structure that is developed on top of Redis modules. (Coming soon)
  • TairCpc, is a data structure developed based on the compressed probability counting (CPC) sketch. (Coming soon)

Installation

go get github.com/alibaba/tair-go

Quickstart

An example of TairString is as follows:

go.mod

require (
	github.com/alibaba/tair-go vx.x.x
)

test.go

import (
	"context"
	"fmt"
	"github.com/go-redis/redis/v8"
	"github.com/alibaba/tair-go/tair"
)

var ctx = context.Background()

var tairClient *tair.TairClient

func init() {
	tairClient = tair.NewTairClient(&redis.Options{
		Addr:     "xxx.redis.rds.aliyuncs.com:6379",
		Password: "xxx",
		DB:       0,
	})
}

func main() {
	err := tairClient.ExSet(ctx, "exkey", "exval").Err()
	if err != nil {
		fmt.Println(err.Error())
	}

	val, err := tairClient.ExGet(ctx, "exkey").Result()
	if err != nil {
		panic(err)
	}
	fmt.Println("get exkey values is: ", val)
}

Tair All SDK

language GitHub
Java https://github.com/alibaba/alibabacloud-tairjedis-sdk
Python https://github.com/alibaba/tair-py
Go https://github.com/alibaba/tair-go
.Net https://github.com/alibaba/AlibabaCloud.TairSDK