captchax

package
v0.3.15 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheStore

type CacheStore struct {
	Cache cache.Cache
}

func NewCacheStore

func NewCacheStore(conf cache.CacheConf) *CacheStore

func (*CacheStore) Get

func (cs *CacheStore) Get(id string, clear bool) (res string)

func (*CacheStore) Set

func (cs *CacheStore) Set(id string, value string) error

func (*CacheStore) Verify

func (cs *CacheStore) Verify(id, answer string, clear bool) bool

type CaptchaConf

type CaptchaConf struct {
	Type      CaptchaType
	Store     StoreType
	CacheConf cache.CacheConf
}

type CaptchaTool

type CaptchaTool struct {
	Conf   CaptchaConf
	Store  base64Captcha.Store
	Driver base64Captcha.Driver
}

func NewCaptchaTool

func NewCaptchaTool(conf CaptchaConf) *CaptchaTool

func (*CaptchaTool) Make

func (t *CaptchaTool) Make() (id, b64s, answer string, err error)

func (*CaptchaTool) VerifyCaptcha

func (t *CaptchaTool) VerifyCaptcha(id string, VerifyValue string, clear bool) bool

type CaptchaType

type CaptchaType int
const (
	DigType     CaptchaType = iota //数字验证码
	MathType                       //数学验证码(加减乘除)
	StringType                     //字符验证码
	ChineseType                    //中文验证码
	AudioType                      //语音验证码
)

* dight 数字验证码 audio 语音验证码 string 字符验证码 math 数学验证码(加减乘除) chinese中文验证码-有bug

type StoreType

type StoreType int
const (
	MemType StoreType = iota
	RedisType
)

Jump to

Keyboard shortcuts

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