Documentation ¶
Overview ¶
Copyright 2019 Yunion
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 ¶
View Source
const ( DriverKey = "sms_driver" DriverAliyun = "smsaliyun" DriverHuawei = "smshuawei" )
View Source
const ( ACCESS_KEY_ID = "access_key_id" ACCESS_KEY_SECRET = "access_key_secret" SIGNATURE = "signature" SERVICE_URL = "service_url" )
View Source
const ( ACESS_KEY_ID_BP = "accessKeyId" ACESS_KEY_SECRET_BP = "accessKeySecret" NEED_REMOTE_TEMPLATE = "remote template is needed in aliyun sms" ACCESSKEYID_NOTFOUND = "InvalidAccessKeyId.NotFound" SIGN_DOESNOTMATCH = "SignatureDoesNotMatch" SIGHNTURE_ILLEGAL = "isv.SMS_SIGNATURE_ILLEGAL" TEMPLATE_ILLGAL = "isv.SMS_TEMPLATE_ILLEGAL" )
View Source
const AUTH_HEADER_VALUE = "WSSE realm=\"SDP\",profile=\"UsernameToken\",type=\"Appkey\""
无需修改,用于格式化鉴权头域,给"Authorization"参数赋值
View Source
const (
HuaweiSendUri = "/sms/batchSendSms/v1"
)
View Source
const (
LARK_MESSAGE_SUCCESS = "success"
)
View Source
const WSSE_HEADER_FORMAT = "UsernameToken Username=\"%s\",PasswordDigest=\"%s\",Nonce=\"%s\",Created=\"%s\""
无需修改,用于格式化鉴权头域,给"X-WSSE"参数赋值
Variables ¶
View Source
var ( ErrAccessKeyIdNotFound = errors.Error("AccessKeyId not found") ErrSignatureDoesNotMatch = errors.Error("AccessKeySecret does not match with the accessKeyId") ErrSignnameInvalid = errors.Error("Invalid signature (does not exist or is blackened)") ErrDriverNotFound = errors.Error("Driver not found") )
Functions ¶
This section is empty.
Types ¶
type SAliyunSMSDriver ¶
type SAliyunSMSDriver struct{}
func (*SAliyunSMSDriver) Name ¶
func (d *SAliyunSMSDriver) Name() string
func (*SAliyunSMSDriver) Send ¶
func (d *SAliyunSMSDriver) Send(args api.SSMSSendParams, isVerify bool, config *api.NotifyConfig) error
func (*SAliyunSMSDriver) Verify ¶
func (d *SAliyunSMSDriver) Verify(config *api.NotifyConfig) error
type SHuaweiSMSDriver ¶
type SHuaweiSMSDriver struct{}
func (*SHuaweiSMSDriver) Name ¶
func (d *SHuaweiSMSDriver) Name() string
func (*SHuaweiSMSDriver) Send ¶
func (d *SHuaweiSMSDriver) Send(args api.SSMSSendParams, isVerify bool, config *api.NotifyConfig) error
func (*SHuaweiSMSDriver) Verify ¶
func (d *SHuaweiSMSDriver) Verify(config *api.NotifyConfig) error
Click to show internal directories.
Click to hide internal directories.