myrds

package
v0.0.0-...-ff80121 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClosePool

func ClosePool() error

ClosePool close redis pool

func Connection

func Connection() redis.Conn

Connection return redis connection. Usage:

conn := redis.Connection()
defer conn.Close()
... do something ...

func GenRedisKey

func GenRedisKey(tpl string, keys ...interface{}) string

GenRedisKey Gen redis key

func HasZSet

func HasZSet(key string) bool

HasZSet

func InitRedis

func InitRedis() (err error)

init redis connection pool redigo doc https://godoc.org/github.com/gomodule/redigo/redis#pkg-examples

func WithConnection

func WithConnection(fn func(c redis.Conn) (interface{}, error)) (interface{}, error)

WithConnection 公共方法,使用 collection 对象 Usage:

error = redis.WithConnection(func (c redis.Conn) error {
    ... do something ...
})

Types

This section is empty.

Jump to

Keyboard shortcuts

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