redigo

package
v1.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

redis

将支持下面的三种模式,分布依赖的包如图介绍

Mode部署模式 依赖包
alone 单机模式 gomodule/redigo
sentinel 哨兵模式 FZambia/sentinel
cluster 集群模式 mna/redisc

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RedisConnPool *redis.Pool

Functions

func CheckRedisRole

func CheckRedisRole(c redis.Conn, t time.Time) error

func GetRedsyncLockPool added in v1.3.6

func GetRedsyncLockPool(host string, port int, user string, password string) redsyncredis.Pool

获取分布式redis锁的 pool

func NewRedisAlone

func NewRedisAlone(addr string, password string) redis.Conn

func NewRedisClient

func NewRedisClient(addr []string, password string, typ int) redis.Conn

redis 有三种模式 1 alone, 2 sentinel, 3 cluster

func NewRedisCluster

func NewRedisCluster(addr []string, password string) redis.Conn

func NewRedisSentinel

func NewRedisSentinel(redisAddrs []string, password string) redis.Conn

func NewRedsyncLockPool added in v1.3.6

func NewRedsyncLockPool(host string, port int, user string, password string) redsyncredis.Pool

分布式锁

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL