Documentation
¶
Index ¶
- Variables
- type AliSmsClient
- func (m *AliSmsClient) SendMarket(sign, templateId, phone string) (bizId string, err error)
- func (m *AliSmsClient) SendNotice(sign, templateId, phone string, templateParam string) (bizId string, err error)
- func (m *AliSmsClient) SendVerifyCode(sign, templateID, phone, code string) (bizId string, err error)
- func (m *AliSmsClient) SetDebug(enabled bool)
- type Manager
- type MessagesRequest
- type MessagesResponse
- type QiNiuSmsClient
- type SingleMessageRequest
- type TencentSmsClient
- type UpYunMessage
- type UpYunResult
- type UpYunSmsBody
- type UpYunSmsClient
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// Host 为 Qiniu SMS Server API 服务域名
Host = "https://sms.qiniuapi.com"
)
Functions ¶
This section is empty.
Types ¶
type AliSmsClient ¶
AliSmsClient aliyun sms client
func NewAliSmsClient ¶
func NewAliSmsClient(accessKeyID, accessKeySecret string) *AliSmsClient
NewAliSmsClient return AliSmsClient
func (*AliSmsClient) SendMarket ¶
func (m *AliSmsClient) SendMarket(sign, templateId, phone string) (bizId string, err error)
SendMarket 营销短信
func (*AliSmsClient) SendNotice ¶
func (m *AliSmsClient) SendNotice(sign, templateId, phone string, templateParam string) (bizId string, err error)
SendNotice 发送通知短信
func (*AliSmsClient) SendVerifyCode ¶
func (m *AliSmsClient) SendVerifyCode(sign, templateID, phone, code string) (bizId string, err error)
SendVerifyCode 验证码短信
type Manager ¶ added in v1.4.3
type Manager struct {
// contains filtered or unexported fields
}
Manager 提供了 Qiniu SMS Server API 相关功能
func NewManager ¶ added in v1.4.3
func NewManager(mac *auth.Credentials) (manager *Manager)
NewManager 用来构建一个新的 Manager
func (*Manager) SendMessage ¶ added in v1.4.3
func (m *Manager) SendMessage(args MessagesRequest) (ret MessagesResponse, err error)
SendMessage 发送短信 可单条 可多条
func (*Manager) SendSingleMessage ¶ added in v1.4.3
func (m *Manager) SendSingleMessage(args SingleMessageRequest) (ret MessagesResponse, err error)
SendSingleMessage 单条发送短信
type MessagesRequest ¶ added in v1.4.3
type MessagesRequest struct {
SignatureID string `json:"signature_id"`
TemplateID string `json:"template_id"`
Mobiles []string `json:"mobiles"`
Parameters map[string]interface{} `json:"parameters"`
}
MessagesRequest 短信消息
type MessagesResponse ¶ added in v1.4.3
type MessagesResponse struct {
JobID string `json:"job_id,omitempty"`
MessageId string `json:"message_id,omitempty"`
}
MessagesResponse 发送短信响应
type QiNiuSmsClient ¶ added in v1.4.2
func NewQiNiuSmsClient ¶ added in v1.4.2
func NewQiNiuSmsClient(accessKey, secretKey string) *QiNiuSmsClient
func (*QiNiuSmsClient) SendVerifyCode ¶ added in v1.4.2
func (s *QiNiuSmsClient) SendVerifyCode(signId, templateId, mobile, code string) (messageId string, err error)
type SingleMessageRequest ¶ added in v1.4.3
type TencentSmsClient ¶ added in v1.4.2
TencentSmsClient tencent sms client
func NewTencentSmsClient ¶ added in v1.4.2
func NewTencentSmsClient(sdkAppId, secretId, secretKey string) *TencentSmsClient
NewTencentSmsClient return TencentSmsClient
func (*TencentSmsClient) SendMarket ¶ added in v1.4.2
func (m *TencentSmsClient) SendMarket(sign, templateID string, phone, templateParam []string) (serialNo map[string]string, err error)
SendMarket 营销类短信 批量号码 发送相同的内容
func (*TencentSmsClient) SendVerifyCode ¶ added in v1.4.2
func (m *TencentSmsClient) SendVerifyCode(sign, templateID, phone, code string) (serialNo string, err error)
SendVerifyCode 验证码短信
type UpYunMessage ¶
UpYunMessage UpYunMessage
type UpYunResult ¶
type UpYunResult struct {
MessageIDS []*UpYunMessage `json:"message_ids"`
}
UpYunResult 返回信息
type UpYunSmsBody ¶
type UpYunSmsBody struct {
Mobile string `json:"mobile"`
TemplateID int64 `json:"template_id"`
Vars string `json:"vars"`
}
UpYunSmsBody 发送模型
type UpYunSmsClient ¶
type UpYunSmsClient struct {
Token string
}
UpYunSmsClient UpYunSmsClient
func NewUpYunSmsClient ¶
func NewUpYunSmsClient(token string) *UpYunSmsClient
NewUpYunSmsClient 返回一个新的client
func (*UpYunSmsClient) SendVerifyCode ¶
func (m *UpYunSmsClient) SendVerifyCode(mobile string, templateId int64, code string) (messageId string, err error)
SendVerifyCode 发送验证码短信
templateId = 模板ID
Click to show internal directories.
Click to hide internal directories.