Versions in this module Expand all Collapse all v0 v0.0.5 Aug 26, 2022 Changes in this version + var ErrCaptchaInconsistent = errors.NewPublic("无效的验证码") + var ErrCaptchaNotExists = errors.NewPublic("验证码不存在") + type Captcha struct + Redis *redis.Client + Values *common.Values + func (x *Captcha) Create(ctx context.Context, name string, code string, ttl time.Duration) error + func (x *Captcha) Delete(ctx context.Context, name string) error + func (x *Captcha) Exists(ctx context.Context, name string) (_ bool, err error) + func (x *Captcha) Key(name string) string + func (x *Captcha) Verify(ctx context.Context, name string, code string) (err error)