gocaptcha

package
v1.2.49 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

验证码

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptchaData

type CaptchaData struct {
	Data      string `json:"data"`
	CaptchaId string `json:"captchaId"`
	Answer    string `json:"answer"`
}

type GoCaptcha

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

func New

func New(store base64Captcha.Store) *GoCaptcha

func NewDefault

func NewDefault() *GoCaptcha

func NewRedis

func NewRedis(config goredis.Config) (*GoCaptcha, error)

new other store

func (*GoCaptcha) AudioCaptcha

func (g *GoCaptcha) AudioCaptcha(language string, length int) (*CaptchaData, error)

func (*GoCaptcha) CaptchaVerify

func (g *GoCaptcha) CaptchaVerify(id, code string) bool

验证

func (*GoCaptcha) ChineseCaptcha

func (g *GoCaptcha) ChineseCaptcha(width, height, length int, source string) (*CaptchaData, error)

source是中文英文字列表

func (*GoCaptcha) DigitCaptcha

func (g *GoCaptcha) DigitCaptcha(width, height, length int) (*CaptchaData, error)

func (*GoCaptcha) GetCaptcha

func (g *GoCaptcha) GetCaptcha(param configJsonBody) (*CaptchaData, error)

返回不同类型的验证码

func (*GoCaptcha) MathCaptcha

func (g *GoCaptcha) MathCaptcha(width, height int) (*CaptchaData, error)

数学计算

func (*GoCaptcha) StringCaptcha

func (g *GoCaptcha) StringCaptcha(width, height, length int) (*CaptchaData, error)

type RedisStore

type RedisStore struct {
	Context context.Context
	// contains filtered or unexported fields
}

func (*RedisStore) Get

func (r *RedisStore) Get(id string, clear bool) string

func (*RedisStore) Set

func (r *RedisStore) Set(id string, value string) error

func (*RedisStore) Verify

func (r *RedisStore) Verify(id, answer string, clear bool) bool

Directories

Path Synopsis
example of HTTP server that uses the captcha package.
example of HTTP server that uses the captcha package.

Jump to

Keyboard shortcuts

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