aliyun

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 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 struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options ...Option) (*Client, error)

func NewClientWithConfig added in v1.3.0

func NewClientWithConfig(config Config) (*Client, error)

func (*Client) Kernel added in v1.3.0

func (client *Client) Kernel() *dysmsapi20170525.Client

func (*Client) SendSms

func (client *Client) SendSms(msg *Message, telephones ...string) error

type Config

type Config struct {
	// 您的AccessKey ID
	AccessKeyId string `mapstructure:"access_key_id" json:"access_key_id"`
	// 您的AccessKey Secret
	AccessKeySecret string `mapstructure:"access_key_secret" json:"access_key_secret"`
	// 访问的域名
	Endpoint string `mapstructure:"endpoint" 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 `mapstructure:"sign_name" json:"sign_name"`
	// TemplateCode 短信模板CODE
	TemplateCode string `mapstructure:"template_code" json:"template_code"`
	// TemplateParam 短信模板变量对应的实际值,eg:{"code":"1234"}
	TemplateParamJson string `mapstructure:"template_param_json" 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

type Option added in v1.3.0

type Option func(config *Config)

func WithAccessKeyId added in v1.3.0

func WithAccessKeyId(accessKeyId string) Option

func WithAccessKeySecret added in v1.3.0

func WithAccessKeySecret(accessKeySecret string) Option

func WithEndpoint added in v1.3.0

func WithEndpoint(endpoint string) Option

Jump to

Keyboard shortcuts

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