captcha

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 3 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
}

func NewCaptcha

func NewCaptcha(opfs ...func(option *Option)) *Captcha

func (*Captcha) GenCode

func (c *Captcha) GenCode(id, value string) (b64s string, err error)

func (*Captcha) GenCodeAuto

func (c *Captcha) GenCodeAuto() (id, value, b64s string, err error)

func (*Captcha) Validate

func (c *Captcha) Validate(id, answer string) bool

type Option

type Option struct {
	// EnableRedis user redis as store.
	EnableRedis bool
	// Height png height in pixel.
	Height int
	// Width Captcha png width in pixel.
	Width int
	// DefaultLen Default number of digits in captcha solution.
	Length int
	// MaxSkew max absolute skew factor of a single digit.
	MaxSkew float64
	// DotCount Number of background circles.
	DotCount int
	// ExpireTime Redis expireTime.
	ExpireTime time.Duration
}

Jump to

Keyboard shortcuts

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