Documentation
¶
Index ¶
- Variables
- type ErrorMessage
- type SMSClient
- func (c *SMSClient) SendMulti(recnum []string, signname, templatecode, paramstring string) (e *ErrorMessage, err error)
- func (c *SMSClient) SendOne(recnum, signname, templatecode, paramstring string) (e *ErrorMessage, err error)
- func (c *SMSClient) SetAccessId(accessid string)
- func (c *SMSClient) SetAccessKey(accesskey string)
- func (c *SMSClient) SetEndPoint(end_point string)
- func (c *SMSClient) SetSocketTimeout(sockettimeout int)
- type SmsParam
- func (this *SmsParam) GetAccessKeyId() string
- func (this *SmsParam) GetAction() string
- func (this *SmsParam) GetFormat() string
- func (this *SmsParam) GetParamString() string
- func (this *SmsParam) GetRecNum() string
- func (this *SmsParam) GetRegionId() string
- func (this *SmsParam) GetSignName() string
- func (this *SmsParam) GetSignatureMethod() string
- func (this *SmsParam) GetSignatureNonce() string
- func (this *SmsParam) GetSignatureVersion() string
- func (this *SmsParam) GetTemplateCode() string
- func (this *SmsParam) GetTimestamp() string
- func (this *SmsParam) GetVersion() string
- func (this *SmsParam) SetAccessKeyId(accesskeyid string)
- func (this *SmsParam) SetAction(action string)
- func (this *SmsParam) SetFormat(format string)
- func (this *SmsParam) SetParamString(paramstring string)
- func (this *SmsParam) SetRecNum(recnum string)
- func (this *SmsParam) SetRegionId(regionid string)
- func (this *SmsParam) SetSignName(signname string)
- func (this *SmsParam) SetSignatureMethod(signaturemethod string)
- func (this *SmsParam) SetSignatureNonce(signaturenonce string)
- func (this *SmsParam) SetSignatureVersion(signatureversion string)
- func (this *SmsParam) SetTemplateCode(templatecode string)
- func (this *SmsParam) SetTimestamp(timestamp string)
- func (this *SmsParam) SetVersion(version string)
Constants ¶
This section is empty.
Variables ¶
View Source
var HttpDebugEnable bool = false
Functions ¶
This section is empty.
Types ¶
type ErrorMessage ¶
type ErrorMessage struct { HttpCode int `json"-"` Model *string `json:"Model,omitempty"` RequestId *string `json:"RequestId,omitempty"` Message *string `json:"Message,omitempty"` Code *string `json:"Code,omitempty"` }
短信服务器返回的错误信息
func (*ErrorMessage) Error ¶
func (e *ErrorMessage) Error() string
func (*ErrorMessage) GetCode ¶
func (e *ErrorMessage) GetCode() string
func (*ErrorMessage) GetHttpCode ¶
func (e *ErrorMessage) GetHttpCode() int
func (*ErrorMessage) GetMessage ¶
func (e *ErrorMessage) GetMessage() string
func (*ErrorMessage) GetModel ¶
func (e *ErrorMessage) GetModel() string
func (*ErrorMessage) GetRequestId ¶
func (e *ErrorMessage) GetRequestId() string
func (*ErrorMessage) SetHttpCode ¶
func (e *ErrorMessage) SetHttpCode(code int)
type SMSClient ¶
type SMSClient struct { // SMS服务的地址,默认为(https://sms.aliyuncs.com) EndPoint string // 访问SMS服务的accessid,通过官方网站申请或通过管理员获取 AccessId string // 访问SMS服务的accesskey,通过官方网站申请或通过管理员获取 AccessKey string // 连接池中每个连接的Socket超时,单位为秒,可以为int或float。默认值为50 SocketTimeout int // 其他参数 Param SmsParam // contains filtered or unexported fields }
func (*SMSClient) SendMulti ¶
func (c *SMSClient) SendMulti(recnum []string, signname, templatecode, paramstring string) (e *ErrorMessage, err error)
发送给多个手机号, 最多100个
func (*SMSClient) SendOne ¶
func (c *SMSClient) SendOne(recnum, signname, templatecode, paramstring string) (e *ErrorMessage, err error)
发送给一个手机号
func (*SMSClient) SetAccessId ¶
设置短信服务的accessid,通过官方网站申请或通过管理员获取
func (*SMSClient) SetAccessKey ¶
设置短信服务的accesskey,通过官方网站申请或通过管理员获取
func (*SMSClient) SetSocketTimeout ¶
设置短信服务的Socket超时,单位为秒,可以为int或float。默认值为50
type SmsParam ¶
type SmsParam struct { Action string SignName string TemplateCode string RecNum string ParamString string Format string Version string AccessKeyId string SignatureMethod string Timestamp string SignatureVersion string SignatureNonce string RegionId string }
func (*SmsParam) GetAccessKeyId ¶
func (*SmsParam) GetParamString ¶
func (*SmsParam) GetRegionId ¶
func (*SmsParam) GetSignName ¶
func (*SmsParam) GetSignatureMethod ¶
func (*SmsParam) GetSignatureNonce ¶
func (*SmsParam) GetSignatureVersion ¶
func (*SmsParam) GetTemplateCode ¶
func (*SmsParam) GetTimestamp ¶
func (*SmsParam) GetVersion ¶
func (*SmsParam) SetAccessKeyId ¶
func (*SmsParam) SetParamString ¶
func (*SmsParam) SetRegionId ¶
func (*SmsParam) SetSignName ¶
func (*SmsParam) SetSignatureMethod ¶
func (*SmsParam) SetSignatureNonce ¶
func (*SmsParam) SetSignatureVersion ¶
func (*SmsParam) SetTemplateCode ¶
func (*SmsParam) SetTimestamp ¶
func (*SmsParam) SetVersion ¶
Click to show internal directories.
Click to hide internal directories.