Documentation
¶
Index ¶
- type BatchSendRequest
- type BatchSendResponse
- type Client
- type Config
- type MultiSendRequest
- type MultiSendResponse
- type RegCompleteRequest
- type RegCompleteResponse
- type SMS
- func (sms *SMS) BatchSend(input *BatchSendRequest) (*BatchSendResponse, error)
- func (sms *SMS) MultiSend(input *MultiSendRequest) (*MultiSendResponse, error)
- func (sms *SMS) RegComplete(input *RegCompleteRequest) (*RegCompleteResponse, error)
- func (sms *SMS) SingleSend(input *SingleSendRequest) (*SingleSendResponse, error)
- func (sms *SMS) TPLBatchSend(input *TPLBatchSendRequest) (*BatchSendResponse, error)
- func (sms *SMS) TPLSingleSend(input *TPLSingleSendRequest) (*SingleSendResponse, error)
- type SingleSendRequest
- type SingleSendResponse
- type TPLBatchSendRequest
- type TPLSingleSendRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchSendRequest ¶
type BatchSendRequest struct {
Mobile string `url:"mobile,omitempty"`
Text string `url:"text,omitempty"`
Extend string `url:"extend,omitempty"`
CallbackURL string `url:"callback_url,omitempty"`
}
BatchSendRequest 批量发送请求参数
type BatchSendResponse ¶
type BatchSendResponse struct {
TotalCount int `json:"total_count"`
TotalFee string `json:"total_fee"`
Unit string `json:"unit"`
Data []SingleSendResponse `json:"data"`
}
BatchSendResponse 批量发送响应结构
type Config ¶
type Config struct {
UseSSL *bool
HTTPClient *http.Client
APIKey *string
Context context.Context
// contains filtered or unexported fields
}
Config 是云片sdk的相关配置项
func (*Config) WithAPIKey ¶
WithAPIKey 设置sdk的API key
func (*Config) WithHTTPClient ¶
WithHTTPClient 设置发送请求的Client
func (*Config) WithUseSSL ¶
WithUseSSL 设置调用API时是否使用HTTPS
type MultiSendRequest ¶
type MultiSendRequest struct {
Mobile string `url:"mobile,omitempty"`
Text string `url:"text,omitempty"`
Extend string `url:"extend,omitempty"`
CallbackURL string `url:"callback_url,omitempty"`
}
MultiSendRequest 批量个性化发送请求参数
type MultiSendResponse ¶
type MultiSendResponse struct {
TotalCount int `json:"total_count"`
TotalFee string `json:"total_fee"`
Unit string `json:"unit"`
Data []SingleSendResponse `json:"data"`
}
MultiSendResponse 批量个性化发送响应
type RegCompleteRequest ¶
RegCompleteRequest 注册成功上报的参数
type RegCompleteResponse ¶
RegCompleteResponse 注册成功上报的响应
func (*RegCompleteResponse) IsSuccess ¶
func (resp *RegCompleteResponse) IsSuccess() bool
IsSuccess 用于验证短信发送是否成功
type SMS ¶
type SMS struct {
*Client
}
SMS 是短信发送客户端
func (*SMS) BatchSend ¶
func (sms *SMS) BatchSend(input *BatchSendRequest) (*BatchSendResponse, error)
BatchSend 批量发送接口
func (*SMS) MultiSend ¶
func (sms *SMS) MultiSend(input *MultiSendRequest) (*MultiSendResponse, error)
MultiSend 批量个性化发送接口
func (*SMS) RegComplete ¶
func (sms *SMS) RegComplete(input *RegCompleteRequest) (*RegCompleteResponse, error)
RegComplete 注册成功上报
func (*SMS) SingleSend ¶
func (sms *SMS) SingleSend(input *SingleSendRequest) (*SingleSendResponse, error)
SingleSend 发送单条短信
func (*SMS) TPLBatchSend ¶
func (sms *SMS) TPLBatchSend(input *TPLBatchSendRequest) (*BatchSendResponse, error)
TPLBatchSend 指定模板群发
func (*SMS) TPLSingleSend ¶
func (sms *SMS) TPLSingleSend(input *TPLSingleSendRequest) (*SingleSendResponse, error)
TPLSingleSend 指定模板单发接口
type SingleSendRequest ¶
type SingleSendRequest struct {
Mobile string `url:"mobile,omitempty"`
Text string `url:"text,omitempty"`
Extend string `url:"extend,omitempty"`
UID string `url:"uid,omitempty"`
CallbackURL string `url:"callback_url,omitempty"`
Register bool `url:"register,omitempty"`
}
SingleSendRequest 单条短信发送请求
type SingleSendResponse ¶
type SingleSendResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Count int `json:"count"`
Fee float64 `json:"fee"`
Unit string `json:"unit"`
Mobile string `json:"mobile"`
SID int64 `json:"sid"`
}
SingleSendResponse 单条短信发送响应
func (*SingleSendResponse) IsSuccess ¶
func (resp *SingleSendResponse) IsSuccess() bool
IsSuccess 用于验证短信发送是否成功
Click to show internal directories.
Click to hide internal directories.