Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCodeVerifyTooManyTime = errors.New("验证码错误次数过多") ErrCodeSendTooMany = errors.New("验证码发送次数过多") )
View Source
var (
ErrKeyNotExist = redis.Nil
)
Functions ¶
This section is empty.
Types ¶
type CodeCache ¶
type CodeCache interface { SetWithPhone(ctx context.Context, biz, phone, code string) error SetWithEmail(ctx context.Context, biz, email, code string) error VerifyWithPhone(ctx context.Context, biz, phone, code string) (bool, error) VerifyWithEmail(ctx context.Context, biz, email, code string) (bool, error) }
func NewRedisCodeCache ¶
func NewRedisCodeCache(client redis.Cmdable) CodeCache
type MemoryCodeCache ¶
type MemoryCodeCache struct {
// contains filtered or unexported fields
}
type RedisUserCache ¶
type RedisUserCache struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.