captcha

package
v1.0.1006 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Captcha

type Captcha struct {
	*base64Captcha.Captcha
}

*

  • 验证码 *
  • id, b64s, err := New().Make() *
  • @create 2021-9-15
  • @author deatil

func New

func New(driver IDriver, store IStore) *Captcha

验证码

func (*Captcha) Make

func (this *Captcha) Make() (string, string, error)

生成验证码

type EmptyStore added in v1.0.1006

type EmptyStore struct{}

*

  • 空存储 *
  • @create 2021-10-18
  • @author deatil

func (*EmptyStore) Get added in v1.0.1006

func (this *EmptyStore) Get(id string, clear bool) string

获取

func (*EmptyStore) Set added in v1.0.1006

func (this *EmptyStore) Set(id string, value string) error

设置

func (*EmptyStore) Verify added in v1.0.1006

func (this *EmptyStore) Verify(id string, answer string, clear bool) bool

验证

type IDriver added in v1.0.1006

type IDriver interface {
	// 画图
	DrawCaptcha(content string) (item base64Captcha.Item, err error)

	// 生成验证码
	GenerateIdQuestionAnswer() (id, q, a string)
}

*

  • 驱动接口 *
  • @create 2021-10-19
  • @author deatil

type IStore added in v1.0.1006

type IStore interface {
	// 设置
	Set(string, string) error

	// 获取
	Get(string, bool) string

	// 验证
	Verify(string, string, bool) bool
}

*

  • 存储接口 *
  • @create 2021-10-18
  • @author deatil

Directories

Path Synopsis
store

Jump to

Keyboard shortcuts

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