smscode

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ali

type Ali struct {
	Client *client.Client
	// contains filtered or unexported fields
}

func (*Ali) Provide

func (ali *Ali) Provide(ctx context.Context) interface{}

func (*Ali) SendSMS

func (ali *Ali) SendSMS(phone, code string) error

SendSMS 发送短信验证码 默认参数名为 code

func (*Ali) SendSMSWithParams

func (ali *Ali) SendSMSWithParams(phone string, params map[string]interface{}) error

SendSMSWithParams 发送验证码指定参数名

func (*Ali) SendSMSWithSignAndTemplate

func (ali *Ali) SendSMSWithSignAndTemplate(phone string, signName string, template string, params map[string]interface{}) error

SendSMSWithSignAndTemplate 发送验证码指定短信签名、模版及参数 https://next.api.aliyun.com/api/Dysmsapi/2017-05-25/SendSms?lang=GO&params={}

func (*Ali) SendSMSWithTemplate

func (ali *Ali) SendSMSWithTemplate(phone string, template string, params map[string]interface{}) error

SendSMSWithTemplate 发送验证码指定模版及参数

type AliOption

type AliOption func(*AliOptions)

func WithAccessKeyId

func WithAccessKeyId(accessKeyId string) AliOption

func WithAccessKeySecret

func WithAccessKeySecret(accessKeySecret string) AliOption

func WithEndpoint

func WithEndpoint(endpoint string) AliOption

func WithSignName

func WithSignName(signName string) AliOption

func WithTempCode

func WithTempCode(tempCode string) AliOption

type AliOptions

type AliOptions struct {
	AccessKeyId     string
	AccessKeySecret string
	Endpoint        string
	SignName        string
	TempCode        string
}

type SMSCode

type SMSCode interface {
	SendSMS(phone, code string) error                                                                               // 发送短信验证码
	SendSMSWithParams(phone string, values map[string]interface{}) error                                            // 发送短信指定参数
	SendSMSWithTemplate(phone string, template string, params map[string]interface{}) error                         // 发送短信指定模版及参数
	SendSMSWithSignAndTemplate(phone string, signName string, template string, params map[string]interface{}) error // 发送短信指定短信签名、模版及参数
}

func NewAliSMS

func NewAliSMS(opts ...AliOption) SMSCode

Jump to

Keyboard shortcuts

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