actualCombat

package
v0.0.0-...-8d22ec3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	Otp
}

邮箱类

func (*Email) GenRandomOTP

func (s *Email) GenRandomOTP(len int) string

func (*Email) GetMessage

func (s *Email) GetMessage(otp string) string

func (*Email) Publish

func (s *Email) Publish()

func (*Email) SaveOTPCache

func (s *Email) SaveOTPCache(otp string)

func (*Email) SendNotification

func (s *Email) SendNotification(message string) error

type IOtp

type IOtp interface {
	GenRandomOTP(int) string
	SaveOTPCache(string)
	GetMessage(string) string
	SendNotification(string) error
	Publish()
}

定义一次性密码接口

type Otp

type Otp struct {
	IOtp IOtp
}

定义一次性密码类

func (*Otp) GenAndSendOTP

func (o *Otp) GenAndSendOTP(otpLength int) error

生成验证码并发送

type Sms

type Sms struct {
	Otp
}

短信类

func (*Sms) GenRandomOTP

func (s *Sms) GenRandomOTP(len int) string

func (*Sms) GetMessage

func (s *Sms) GetMessage(otp string) string

func (*Sms) Publish

func (s *Sms) Publish()

func (*Sms) SaveOTPCache

func (s *Sms) SaveOTPCache(otp string)

func (*Sms) SendNotification

func (s *Sms) SendNotification(message string) error

Jump to

Keyboard shortcuts

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