sms

package
v0.0.0-...-f523cfd Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package sms .

api for https://help.aliyun.com/document_detail/101300.html

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPhoneNumbersLimited  .
	ErrPhoneNumbersLimited = errors.New("phone numbers limited, SendSms can only send 1000 phone numbers one time")
	// ErrPhoneNumbersIsNull  .
	ErrPhoneNumbersIsNull = errors.New("phone numbers required")
)

Functions

func NewSMSOfficialClientWithConfig

func NewSMSOfficialClientWithConfig(cnf OfficialConfigSMS)

func SendOfficialSms

func SendOfficialSms(PhoneNumbers string, code string) error

Types

type OfficialConfigSMS

type OfficialConfigSMS struct {
	RegionId     string `default:"cn-hangzhou"`
	AccessKeyId  string
	AccessSecret string
	SignName     string //阿里云验证过的项目名 自己设置
	TemplateCode string //阿里云的短信模板号 自己设置
}

type Option

type Option struct {
	// contains filtered or unexported fields
}

Option .

func NewAPI

func NewAPI(host, accessKeyID, accessSecret, regionID, version string) *Option

NewAPI .

func (*Option) SendBatchSms

func (p *Option) SendBatchSms(phones, signNames []string, templateCode string, templateParams []string) (*Response, error)

SendBatchSms .

func (*Option) SendSms

func (p *Option) SendSms(phones []string, signName, templateCode, templateParam string) (*Response, error)

SendSms .

type Response

type Response struct {
	Code      string `json:"Code"`
	Message   string `json:"Message"`
	RequestID string `json:"RequestId"`
	BizID     string `json:"BizId"`
}

Response for sms request.

func (Response) Error

func (p Response) Error() error

Error .

Jump to

Keyboard shortcuts

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