redis

package
v0.0.0-...-73ddb9c Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ExpSMSRecover = 10 * time.Minute

ExpSMSRecover sms 密码找回服务的键值对有效期

View Source
const ExpSMSRecoverRetry = 58 * time.Second

ExpSMSRecoverRetry sms 密码找回冷却期的键值对有效期

View Source
const ExpSMSSignUp = 10 * time.Minute

ExpSMSSignUp sms 用户注册服务的键值对有效期

View Source
const ExpSMSSignUpRetry = 58 * time.Second

ExpSMSSignUpRetry sms 用户注册冷却期的键值对有效期

View Source
const TagSMSRecover = "SMS_Recover"

TagSMSRecover sms 密码找回服务的 tag

View Source
const TagSMSRecoverRetry = "SMS_Recover_Retry"

TagSMSRecoverRetry sms 密码找回冷却期的 tag

View Source
const TagSMSSignUp = "SMS_SignUp"

TagSMSSignUp sms 用户注册服务的 tag

View Source
const TagSMSSignUpRetry = "SMS_SignUp_Retry"

TagSMSSignUpRetry sms 用户注册冷却期的 tag

Variables

This section is empty.

Functions

func GetKV

func GetKV(tag string, key string) (string, error)

GetKV 获得一个键值对中的值.

Throws: redis.Nil 表示找不到此 key.

func GetKVExp

func GetKVExp(tag string, key string) (time.Duration, error)

GetKVExp 获得一个键值对的剩余过期时间.

Throws: redis.Nil 表示找不到此 key.

func GetRedis

func GetRedis() (client *redis.Client, err error)

GetRedis 获得 redis 的 client 单例

func PutKV

func PutKV(tag string, key string, value string, exp time.Duration) error

PutKV 存放一个键值对,含有有效期

Types

This section is empty.

Jump to

Keyboard shortcuts

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