Home

Awesome

tair-go

build workflow Go Reference

English | 简体中文

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

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/redis/go-redis/v9"
	"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

languageGitHub
Javahttps://github.com/alibaba/alibabacloud-tairjedis-sdk
Pythonhttps://github.com/alibaba/tair-py
Gohttps://github.com/alibaba/tair-go
.Nethttps://github.com/alibaba/AlibabaCloud.TairSDK