Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CacheKeySMSCode 短信验证码的缓存key CacheKeySMSCode string = "smscode:" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AliyunProvider ¶
type ISMSProvider ¶
func NewAliyunInternationalProvider ¶
func NewAliyunInternationalProvider(ctx *config.Context) ISMSProvider
NewAliyunInternationalProvider 创建短信服务
func NewAliyunProvider ¶
func NewAliyunProvider(ctx *config.Context) ISMSProvider
NewAliyunProvider 创建短信服务
func NewUnismsProvider ¶
func NewUnismsProvider(ctx *config.Context) ISMSProvider
NewUnismsProvider 创建短信服务
type ISMSService ¶
type ISMSService interface { // 发送验证码 SendVerifyCode(ctx context.Context, zone, phone string, codeType CodeType) error // 验证验证码(销毁缓存) Verify(ctx context.Context, zone, phone, code string, codeType CodeType) error }
ISMSService ISMSService
type SMSService ¶
SMSService 短信服务
func (*SMSService) SendVerifyCode ¶
func (s *SMSService) SendVerifyCode(ctx context.Context, zone, phone string, codeType CodeType) error
SendVerifyCode 发送验证码
Click to show internal directories.
Click to hide internal directories.