utils

package
v0.0.0-...-a277c89 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenRandFourDigits

func GenRandFourDigits() func() string

GenRandFourDigits 生成随机的 四位非负整数

func GenerateToken

func GenerateToken(id string) (token string, err error)

GenerateToken 生成 token 对称加密

func GenerateUuid

func GenerateUuid() string

Types

type Data

type Data struct {
	Code string
}

type EmailService

type EmailService struct {
	*mail.Client
	GenCaptcha func() string
}

func NewEmailService

func NewEmailService() (*EmailService, error)

NewEmailService 实例化邮件服务

func (*EmailService) Send

func (e *EmailService) Send(from, to, subject, content string) (err error)

Send 发送邮件

func (*EmailService) SendCaptcha

func (e *EmailService) SendCaptcha(to string) error

SendCaptcha 发送四位随机数验证码邮件

Jump to

Keyboard shortcuts

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