rds

package
v0.0.0-...-ac0283c Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MulanPSL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DB

func DB(db int) *redis.Client

func Init

func Init(add, pwd string) error

func Lock

func Lock(ctx context.Context, c *redis.Client, key, uniID string, expiration time.Duration) (success bool)

func LockSentinel

func LockSentinel(ctx context.Context, c *redis.ClusterClient, key, uniID string, expiration time.Duration) (success bool)

func NewClient

func NewClient(addr, pwd string, db int) *redis.Client

func NewSentinelClient

func NewSentinelClient(masterName, sentinelPassword, pwd string, sentinels []string, db int) *redis.Client

func NewSentinelClusterClient

func NewSentinelClusterClient(masterName, sentinelPassword, pwd string, sentinelAddrs []string, db int) *redis.ClusterClient

NewSentinelClusterClient deprecated!!! 连接cluster模式的redis集群 哨兵集群请使用NewSentinelClient方法

func Unlock

func Unlock(ctx context.Context, c *redis.Client, key, uniID string) (success bool)

func UnlockSentinel

func UnlockSentinel(ctx context.Context, c *redis.ClusterClient, key, uniID string) (success bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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