Documentation ¶
Overview ¶
Copyright 2014 mit.zhao.chiu@gmail.com
Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2015 mit.zhao.chiu@gmail.com
Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2015 mint.zhao.chiu@gmail.com
Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2015 mint.zhao.chiu@gmail.com
Licensed under the Apache License, Version 2.0 (the "License"): you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- type SendSMSRequest
- type SendSMSResponse
- type SmsManager
- func (s *SmsManager) Code(tel string) (string, error)
- func (s *SmsManager) GetCompany() string
- func (s *SmsManager) GetService() SmsServicer
- func (s *SmsManager) SendSMS(text string, mobiles []string)
- func (s *SmsManager) SendSMS_tpl(tplid int64, mobiles []string, arg ...string)
- func (s *SmsManager) Verify(tel, code string) (success bool)
- type SmsResult
- type SmsServicer
- type SmsUser
- type YunPianService
- type YuntongxunService
Constants ¶
const ( Tpl_YP_1 int64 = iota + 1 Tpl_YP_2 Tpl_YP_3 Tpl_YP_4 Tpl_YP_5 Tpl_YP_6 Tpl_YP_7 Tpl_YP_8 Tpl_YP_9 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SendSMSRequest ¶
type SendSMSResponse ¶
type SmsManager ¶
type SmsManager struct {
// contains filtered or unexported fields
}
func NewDefaultSmsManager ¶
func NewDefaultSmsManager(company string, service SmsServicer) *SmsManager
默认短信manager
func NewSmsManager ¶
func NewSmsManager(len int, expire time.Duration, store cache.Cache, service SmsServicer, cLen int, company string) *SmsManager
新建短信manager
func (*SmsManager) GetCompany ¶
func (s *SmsManager) GetCompany() string
func (*SmsManager) GetService ¶
func (s *SmsManager) GetService() SmsServicer
func (*SmsManager) SendSMS_tpl ¶
func (s *SmsManager) SendSMS_tpl(tplid int64, mobiles []string, arg ...string)
模版短信
func (*SmsManager) Verify ¶
func (s *SmsManager) Verify(tel, code string) (success bool)
varify sms code
type SmsServicer ¶
type SmsUser ¶
type SmsUser struct { Nick string `json:"nick"` Created string `json:"gmt_created"` Mobile string `json:"mobile"` Email string `json:"email"` IpWhites string `json:"ip_whitelist"` ApiVersion string `json:"api_version"` Balance uint64 `json:"balance"` AlarmBalance uint64 `json:"alarm_balance"` EmergencyContact string `json:"emergency_contact"` EmergencyMobile string `json:"emergency_mobile"` }
type YunPianService ¶
type YunPianService struct {
ApiKey string
}
func (*YunPianService) GetUserInfo ¶
func (y *YunPianService) GetUserInfo() (*SmsUser, error)
* * 取账户信息
func (*YunPianService) SendSMS ¶
func (y *YunPianService) SendSMS(text string, mobiles []string) (*SmsResult, error)
* * 发短信
func (*YunPianService) SendSMS_Tpl ¶
func (y *YunPianService) SendSMS_Tpl(tplid int64, mobiles []string, args []string) (*SmsResult, error)
* * 通过模版发送短信
type YuntongxunService ¶
type YuntongxunService struct {
// contains filtered or unexported fields
}
func NewYuntongxun ¶
func NewYuntongxun(account, token, appId string) *YuntongxunService
func (*YuntongxunService) GetUserInfo ¶
func (this *YuntongxunService) GetUserInfo() (*SmsUser, error)
func (*YuntongxunService) SendSMS ¶
func (this *YuntongxunService) SendSMS(string, []string) (*SmsResult, error)