captcha

package module
v0.0.0-...-8585d0b Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: LGPL-2.1 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmailUser     string
	EmailPassword string
	EmailHost     string
	EmailAddr     string
	EmailSender   string
)
View Source
var CaptchaPath string = "./data/captcha"

Functions

func InitConfig

func InitConfig(emailUser, emailPassword, emailHost, emailAddr, emailSender string)

Types

type GetCaptcha

type GetCaptcha struct {
	httputil.Handler

	Request  struct{}
	Response struct {
		Width        int    `json:"width"`
		Height       int    `json:"height"`
		ImageBase64  string `json:"image_base64"`
		ThumbaBase64 string `json:"thumba_base64"`
		CaptchaKey   string `json:"key"`
	}
}

func (GetCaptcha) Run

func (c GetCaptcha) Run(ctx *gin.Context)

type GetEmailCode

type GetEmailCode struct {
	httputil.Handler

	Request struct {
		Email string `json:"email"`
	}

	Response struct {
		EmailKey string `json:"emailKey"`
	}
}

func (GetEmailCode) Run

func (c GetEmailCode) Run(ctx *gin.Context)

type IMail

type IMail interface {
	CodeEmailSend(sendto []string, code string) error
}

type Mail

type Mail struct {
	Sender  string
	To      []string
	Subject string
	Body    string
}

func NewMail

func NewMail(subject string) *Mail

func (*Mail) BuildMessage

func (m *Mail) BuildMessage() string

func (*Mail) CodeEmailSend

func (m *Mail) CodeEmailSend(sendto []string, code string) error

type VerifyCaptcha

type VerifyCaptcha struct {
	httputil.Handler

	Request struct {
		CaptchaKey string `json:"key" validate:"required"`
		Dots       string `json:"dots" validate:"required"`
	}
	Response struct{}
}

func (VerifyCaptcha) Run

func (c VerifyCaptcha) Run(ctx *gin.Context)

type VerifyEmailCode

type VerifyEmailCode struct {
	httputil.Handler

	Request struct {
		EmailKey string `json:"emailKey"`
		Code     string `json:"code"`
	}
}

func (VerifyEmailCode) CheckCode

func (c VerifyEmailCode) CheckCode(key, code string) error

func (VerifyEmailCode) Run

func (c VerifyEmailCode) Run(ctx *gin.Context)

Jump to

Keyboard shortcuts

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