const.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package smsdriver
  15. import "yunion.io/x/pkg/errors"
  16. const (
  17. DriverKey = "sms_driver"
  18. DriverAliyun = "smsaliyun"
  19. DriverHuawei = "smshuawei"
  20. )
  21. const (
  22. ACCESS_KEY_ID = "access_key_id"
  23. ACCESS_KEY_SECRET = "access_key_secret"
  24. SIGNATURE = "signature"
  25. SERVICE_URL = "service_url"
  26. )
  27. var (
  28. ErrAccessKeyIdNotFound = errors.Error("AccessKeyId not found")
  29. ErrSignatureDoesNotMatch = errors.Error("AccessKeySecret does not match with the accessKeyId")
  30. ErrSignnameInvalid = errors.Error("Invalid signature (does not exist or is blackened)")
  31. ErrDriverNotFound = errors.Error("Driver not found")
  32. )
  33. const (
  34. ACESS_KEY_ID_BP = "accessKeyId"
  35. ACESS_KEY_SECRET_BP = "accessKeySecret"
  36. NEED_REMOTE_TEMPLATE = "remote template is needed in aliyun sms"
  37. ACCESSKEYID_NOTFOUND = "InvalidAccessKeyId.NotFound"
  38. SIGN_DOESNOTMATCH = "SignatureDoesNotMatch"
  39. SIGHNTURE_ILLEGAL = "isv.SMS_SIGNATURE_ILLEGAL"
  40. TEMPLATE_ILLGAL = "isv.SMS_TEMPLATE_ILLEGAL"
  41. )
  42. const (
  43. HuaweiSendUri = "/sms/batchSendSms/v1"
  44. )