smscode

package
v1.11.8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 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, text string) error

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

func (*Ali) SendSMSWithParams

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

SendSMSWithParams 发送验证码指定kv结构参数 https://next.api.aliyun.com/api/Dysmsapi/2017-05-25/SendSms?lang=GO&params={}

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, text string) error                                    // 发送短信验证码
	SendSMSWithParams(phone string, values map[string]interface{}) error // 发送短信指定kv结构参数
}

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