utilCaptcha

package
v0.0.0-...-123eced Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptchaCode

type CaptchaCode struct {
	Id     string        `json:"id,omitempty"`
	Val    string        `json:"val,omitempty"`
	Image  string        `json:"image,omitempty"`
	SendTo string        `json:"send_to,omitempty"`
	Expire time.Duration `json:"expire,omitempty"`
}

type CaptchaService

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

func NewCaptchaService

func NewCaptchaService(cache *utilCache.Cache, prefix string, ttl ...time.Duration) *CaptchaService

func (*CaptchaService) GenerateImageMath

func (c *CaptchaService) GenerateImageMath(width int, height int, ttl ...time.Duration) (code *CaptchaCode, err error)

func (*CaptchaService) GenerateImageString

func (c *CaptchaService) GenerateImageString(width int, height int, codeLen int, ttl ...time.Duration) (code *CaptchaCode, err error)

func (*CaptchaService) SetFonts

func (c *CaptchaService) SetFonts(fonts []string) *CaptchaService

func (*CaptchaService) SetFontsStorage

func (c *CaptchaService) SetFontsStorage(storage base64Captcha.FontsStorage) *CaptchaService

func (*CaptchaService) Verify

func (c *CaptchaService) Verify(id string, val string, sendTo string, clear bool) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳