Help us shape the future of Go! Take the 2026 Go Developer Survey

captcha

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCaptchaNotExists    = errors.NewPublic("验证码不存在")
	ErrCaptchaInconsistent = errors.NewPublic("无效的验证码")
)

Functions

This section is empty.

Types

type Captcha

type Captcha struct {
	Values *common.Values
	Redis  *redis.Client
}

func (*Captcha) Create

func (x *Captcha) Create(ctx context.Context, name string, code string, ttl time.Duration) error

Create 创建验证码

func (*Captcha) Delete

func (x *Captcha) Delete(ctx context.Context, name string) error

Delete 移除验证码

func (*Captcha) Exists

func (x *Captcha) Exists(ctx context.Context, name string) (_ bool, err error)

Exists 存在验证码

func (*Captcha) Key

func (x *Captcha) Key(name string) string

Key 验证命名

func (*Captcha) Verify

func (x *Captcha) Verify(ctx context.Context, name string, code string) (err error)

Verify 校验验证码

Jump to

Keyboard shortcuts

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