aliyun

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SendSms(msg *Message, telephones ...string) error
}

func NewClient

func NewClient(config Config) (Client, error)

type Config

type Config struct {
	// 您的AccessKey ID
	AccessKeyId string `json:"access_key_id"`
	// 您的AccessKey Secret
	AccessKeySecret string `json:"access_key_secret"`
	// 访问的域名
	Endpoint string `json:"endpoint"`
}

type FailedInfo

type FailedInfo struct {
	Telephone string `json:"telephone"`
	Message   string `json:"message"`
}

FailedInfo 发送失败的短信信息

type Message

type Message struct {
	// SignName 短信签名名称,eg: "阿里云"
	SignName string `json:"sign_name"`
	// TemplateCode 短信模板CODE
	TemplateCode string `json:"template_code"`
	// TemplateParam 短信模板变量对应的实际值,eg:{"code":"1234"}
	TemplateParamJson string `json:"template_param_json"`
}

func NewMessage

func NewMessage() *Message

func (*Message) WithSignName

func (msg *Message) WithSignName(sign string) *Message

func (*Message) WithTemplate

func (msg *Message) WithTemplate(code string, param map[string]interface{}) *Message

Jump to

Keyboard shortcuts

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