入手redis第三方庫

官網:https://github.com/gomodule/redigo

安裝:

go get github.com/gomodule/redigo/redis

文檔地址:https://godoc.org/github.com/gomodule/redigo/redis#pkg-examples

1、簡單封裝redis連接客戶端
新建src/MyRedis.go

package src

import (
	"github.com/gomodule/redigo/redis"
	"time"
)

var RedisDefaultPool *redis.Pool

func init() {
	RedisDefaultPool = 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章