redis

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lock

func Lock(redisDb *redis.Client, key string, value string, timeout time.Duration) (ok bool, err error)

func MustSetup

func MustSetup(c RedisConf) *redis.Client

根据redis配置初始化一个客户端

func NextOneFromDelayed

func NextOneFromDelayed(redisDb *redis.Client, key string, min, max string) (result string, score int64, err error)

func Unlock

func Unlock(redisDb *redis.Client, key string, value string) (bool, error)

Types

type RedisConf

type RedisConf struct {
	Host     string
	Type     string `json:",default=node,options=node|cluster"`
	Pass     string `json:",optional"`
	Tls      bool   `json:",default=false,options=true|false"`
	DB       int    `json:",default=0"`
	PoolSize int    `json:",default=10"`
}

Jump to

Keyboard shortcuts

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