Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 验证码发送频繁 ErrCodeSendTooMany = errors.New("code send too many") // 发送验证码遇到未知错误 ErrUnknownForCode = errors.New("unknown error for code") ErrCodeVerifyTooManyTimes = errors.New("code verify too many times") )
View Source
var ErrCacheMiss = errors.New("cache: miss")
var ErrKeyNotExist = redis.Nil
Functions ¶
This section is empty.
Types ¶
type CodeCache ¶
type CodeCache interface { Set(ctx context.Context, biz, phone, code string) error Verify(ctx context.Context, biz, phone, inputCode string) (bool, error) }
func NewCodeCache ¶
func NewCodeCache(client redis.Cmdable) CodeCache
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.