Documentation ¶
Index ¶
- Constants
- func NewSmsNotifier(logger log.Logger, receivers []config.Receiver, notifierCfg *config.Config) notifier.Notifier
- func Register(name string, p ProviderFactory)
- type AliyunNotifier
- type HuaweiNotifier
- type HuaweiResponse
- type Notifier
- type Provider
- func NewAliyunProvider(c *config.Config, providers *v2beta2.Providers, phoneNumbers []string) Provider
- func NewHuaweiProvider(c *config.Config, providers *v2beta2.Providers, phoneNumbers []string) Provider
- func NewTencentProvider(c *config.Config, providers *v2beta2.Providers, phoneNumbers []string) Provider
- type ProviderFactory
- type TencentNotifier
Constants ¶
View Source
const ( HuaweiMaxPhoneNums = 200 DefaultUrl = "https://rtcsms.cn-north-1.myhuaweicloud.com:10743/sms/batchSendSms/v1" )
View Source
const ( DefaultSendTimeout = time.Second * 5 DefaultTemplate = `{{ template "nm.default.text" . }}` )
Variables ¶
This section is empty.
Functions ¶
func NewSmsNotifier ¶
func Register ¶
func Register(name string, p ProviderFactory)
Types ¶
type AliyunNotifier ¶
type AliyunNotifier struct { SignName string NotifierCfg *config.Config TemplateCode string AccessKeyId *v2beta2.Credential AccessKeySecret *v2beta2.Credential PhoneNums string }
func (*AliyunNotifier) MakeRequest ¶
func (a *AliyunNotifier) MakeRequest(ctx context.Context, messages string) error
type HuaweiNotifier ¶ added in v1.3.0
type HuaweiNotifier struct { Signature string NotifierCfg *config.Config TemplateId string AppKey *v2beta2.Credential AppSecret *v2beta2.Credential PhoneNums string Sender string TemplateParas string Url string }
func (*HuaweiNotifier) MakeRequest ¶ added in v1.3.0
func (h *HuaweiNotifier) MakeRequest(ctx context.Context, messages string) error
type HuaweiResponse ¶ added in v1.3.0
type ProviderFactory ¶
type ProviderFactory func(c *config.Config, providers *v2beta2.Providers, phoneNumbers []string) Provider
func GetProviderFunc ¶
func GetProviderFunc(name string) (ProviderFactory, error)
type TencentNotifier ¶
type TencentNotifier struct { Sign string NotifierCfg *config.Config TemplateID string SecretId *v2beta2.Credential SecretKey *v2beta2.Credential PhoneNums []string SmsSdkAppid string }
func (*TencentNotifier) MakeRequest ¶
func (t *TencentNotifier) MakeRequest(ctx context.Context, messages string) error
Click to show internal directories.
Click to hide internal directories.