aliyun

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

阿里云 短信发送

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandomString

func GetRandomString(length int) string

生成随机字符串

func SendMessage

func SendMessage(userInput *UserParams) (bool, string, error)

func SendSms

func SendSms(tplCode, mobile, code string) bool

func SendSmsLoginCode

func SendSmsLoginCode(mobile, code string) bool

其他模板

func SendSmsRegCode

func SendSmsRegCode(mobile, code string) bool

注册模板

func SendSmsResetCode

func SendSmsResetCode(mobile, code string) bool

其他模板

func Sign

func Sign(appSecret, paramsEncodeValue string) string

func SpecialUrlEncode

func SpecialUrlEncode(str string) string

Types

type Params

type Params map[string]string

func (Params) Get

func (t Params) Get(key string) string

func (Params) Set

func (t Params) Set(key, value string)

func (Params) SetInterface

func (t Params) SetInterface(key string, value interface{})

func (*Params) SortToJoin

func (t *Params) SortToJoin() string

type SendSmsResponse

type SendSmsResponse struct {
	Message   string
	RequestId string
	BizId     string
	Code      string
}

type UserParams

type UserParams struct {
	AccessKeyId     string
	AppSecret       string
	PhoneNumbers    string // 接收手机号
	SignName        string // 短信签名
	TemplateCode    string // 短信模板ID
	TemplateParam   string // 短信模板变量替换JSON串,友情提示:如果JSON中需要带换行符,请参照标准的JSON协议对换行符的要求,比如短信内容中包含\r\n的情况在JSON中需要表示成\r\n,否则会导致JSON在服务端解析失败
	SmsUpExtendCode string // 上行短信扩展码,无特殊需要此字段的用户请忽略此字段
	OutId           string // 外部流水扩展字段
}

Jump to

Keyboard shortcuts

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