captchax

package
v0.0.0-...-0cfe510 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedisStore

func NewRedisStore(redis *redis.Redis, expiration time.Duration) *redisStore

Types

type Base64CaptchaConfig

type Base64CaptchaConfig struct {
	Id            string
	CaptchaType   string
	VerifyValue   string
	DriverAudio   *base64Captcha.DriverAudio
	DriverString  *base64Captcha.DriverString
	DriverChinese *base64Captcha.DriverChinese
	DriverMath    *DriverMath
	DriverDigit   *base64Captcha.DriverDigit
}

configJsonBody json request body.

type Base64CaptchaX

type Base64CaptchaX struct {
	Store base64Captcha.Store
}

func NewBase64CaptchaX

func NewBase64CaptchaX(redis *redis.Redis, expiration time.Duration) *Base64CaptchaX

func (*Base64CaptchaX) GenerateBase64Captcha

func (bc *Base64CaptchaX) GenerateBase64Captcha(param Base64CaptchaConfig) (id, b64s string, err error)

base64Captcha create http handler

type DriverMath

type DriverMath struct {
	// contains filtered or unexported fields
}

DriverMath captcha config for captcha math

func NewDriverMath

func NewDriverMath(height int, width int, noiseCount int, showLineOptions int, bgColor *color.RGBA, fontsStorage base64Captcha.FontsStorage, fonts []string) *DriverMath

NewDriverMath creates a driver of math

func (*DriverMath) ConvertFonts

func (d *DriverMath) ConvertFonts() *DriverMath

ConvertFonts loads fonts from names

func (*DriverMath) DrawCaptcha

func (d *DriverMath) DrawCaptcha(question string) (item base64Captcha.Item, err error)

DrawCaptcha creates math captcha item

func (*DriverMath) GenerateIdQuestionAnswer

func (d *DriverMath) GenerateIdQuestionAnswer() (id, question, answer string)

GenerateIdQuestionAnswer creates id,captcha content and answer

type SmsCaptchaX

type SmsCaptchaX struct {
	// contains filtered or unexported fields
}

func NewSmsCaptchaX

func NewSmsCaptchaX(sender sms.SmsSender, redis *redis.Redis, expiration time.Duration) *SmsCaptchaX

func (*SmsCaptchaX) Send

func (sc *SmsCaptchaX) Send(mobile string) error

func (*SmsCaptchaX) Verify

func (sc *SmsCaptchaX) Verify(mobile, answer string, clear bool) bool

Jump to

Keyboard shortcuts

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