Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCodeSendTooMany = errors.New("发送验证码太频繁") ErrCodeVerifyTooManyTimes = errors.New("验证次数太多") ErrUnknownForCode = errors.New("我也不知发生什么了,反正是跟 code 有关") )
View Source
var ErrKeyNotExist = redis.Nil
Functions ¶
This section is empty.
Types ¶
type CodeLruCache ¶
type CodeRedisCache ¶
type CodeRedisCache interface { Set(ctx context.Context, biz, phone, inputCode string) error Verify(ctx context.Context, biz, phone, inputCode string) (bool, error) }
func NewCodeCache ¶
func NewCodeCache(client redis.Cmdable) CodeRedisCache
type RedisCodeCache ¶
type RedisCodeCache struct {
// contains filtered or unexported fields
}
type RedisUserCache ¶
type RedisUserCache struct {
// contains filtered or unexported fields
}
Directories
¶
Path | Synopsis |
---|---|
Package cachemocks is a generated GoMock package.
|
Package cachemocks is a generated GoMock package. |
Package redismocks is a generated GoMock package.
|
Package redismocks is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.