captchas

package
v0.0.0-...-dae8c3a Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Capt = func(platform string) *Captcha {
	return DefaultCaptcha(platform)
}

Capt 生成默认验主码

View Source
var CaptchaSource = "0123456789"

CaptchaSource 默认生成图片Source

Functions

This section is empty.

Types

type Captcha

type Captcha struct {
	Driver base64Captcha.Driver
	Store  base64Captcha.Store
}

Captcha 生成验证码

func DefaultCaptcha

func DefaultCaptcha(siteCode string) *Captcha

DefaultCaptcha 生成默认验证码

func NewCaptcha

func NewCaptcha(siteCode string, height, width, length int, source string) *Captcha

NewCaptcha 生成指定宽高的验证码

func NewCaptchaWith

func NewCaptchaWith(siteCode string, height, width, length int) *Captcha

NewCaptchaWith 生成指定宽高验证码

func (*Captcha) GenerateCaptcha

func (ths *Captcha) GenerateCaptcha() (map[string]interface{}, error)

GenerateCaptcha 生成验证码

func (*Captcha) Verify

func (ths *Captcha) Verify(id, verifyValue string) bool

Verify 校验验证码

type StoreRedis

type StoreRedis struct {
	Code string // 平台名称
}

StoreRedis 生成图片保存redis

func (*StoreRedis) Get

func (ths *StoreRedis) Get(id string, clear bool) string

Get 获取redis的值

func (*StoreRedis) Set

func (ths *StoreRedis) Set(id string, value string) error

Set 设置redis的值

func (*StoreRedis) Verify

func (ths *StoreRedis) Verify(id, answer string, clear bool) bool

Verify 校验redis的值

Jump to

Keyboard shortcuts

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