captcha

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 11 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[T any] struct {
	Client *cache.Client
}

func NewCaptcha

func NewCaptcha[T any](c *cache.Client) *Captcha[T]

func (*Captcha[T]) Delete

func (c *Captcha[T]) Delete(key string, uuid string) error

func (*Captcha[T]) Generate

func (c *Captcha[T]) Generate(key string, expir time.Duration) (string, error)

func (*Captcha[T]) Verify

func (c *Captcha[T]) Verify(key string, uuid string, code string) error

type Email

type Email struct {
	Client *cache.Client
	Email  *email.Email
}

func NewEmail

func NewEmail(c *cache.Client, e *email.Email) *Email

func (*Email) Delete

func (e *Email) Delete(uuid string) error

func (*Email) Generate

func (e *Email) Generate(carrier string, expir time.Duration) (string, error)

func (*Email) Verify

func (e *Email) Verify(carrier string, uuid string, code string) error

type Image

type Image struct {
	Client *cache.Client
	Config *ImageConfig
}

func NewImage

func NewImage(c *cache.Client, config *ImageConfig) *Image

func (*Image) Delete

func (i *Image) Delete(uuid string) error

func (*Image) Generate

func (i *Image) Generate(expir time.Duration) (string, string, error)

func (*Image) Verify

func (i *Image) Verify(uuid string, code string) error

type ImageConfig

type ImageConfig struct {
	Width      int `json:"width"`
	Height     int `json:"height"`
	Length     int `json:"length"`
	NoiseCount int `json:"noise_count"`
}

type Sms

type Sms struct {
	Client *cache.Client
	AliSms *ali.AliSms
}

func NewSms

func NewSms(c *cache.Client, a *ali.AliSms) *Sms

func (*Sms) Delete

func (s *Sms) Delete(uuid string) error

func (*Sms) Generate

func (s *Sms) Generate(carrier string, expir time.Duration) (string, error)

func (*Sms) Verify

func (s *Sms) Verify(carrier string, uuid string, code string) error

Jump to

Keyboard shortcuts

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