Documentation ¶
Index ¶
- Constants
- func AbbreviateValues(m map[string]string, max int) interface{}
- func FilterSlice(slice []string, m map[string]bool) []string
- func GetQywxAccessToken(corpID, corpSecret string) (string, error)
- func HandleHome(app *App, homeTemplate string) func(w http.ResponseWriter, r *http.Request)
- func HandleRaw(app *App, path string) func(w http.ResponseWriter, r *http.Request)
- func HandleRedlist(a *App) func(w http.ResponseWriter, r *http.Request)
- func HmacMD5(key, data string) string
- func SendEWSEmail(c ews.Client, to []string, subject, body string) error
- func SliceToMap(slice []string) map[string]bool
- func TrimSpaceToLower(s string) string
- func WriteErrorJSON(statusCode int, w http.ResponseWriter, v interface{}) error
- func WriteJSON(w http.ResponseWriter, v interface{}) error
- type AlibabaAliqinFcSmsNumSendRequest
- type AlibabaRequest
- type AlidayuTester
- type AliyunDaYuSms
- type AliyunDaYuSmsErrorRsp
- type AliyunDaYuSmsReq
- type AliyunDaYuSmsRsp
- type AliyunSms
- type AliyunSmsReq
- type AliyunSmsRsp
- type AliyunsmsTester
- type App
- func (a *App) DeleteConfig(w http.ResponseWriter, l int, subs []string) error
- func (a *App) GetConfig(w http.ResponseWriter, l int, subs []string) error
- func (a *App) NotifyByConfig(removePath string) func(w http.ResponseWriter, r *http.Request)
- func (a *App) NotifyByConfigID(configID string, req Request) NotifyRsp
- func (a *App) PostConfig(w http.ResponseWriter, r *http.Request, l int, subs []string) error
- func (a *App) ServeByConfig(path string) func(w http.ResponseWriter, r *http.Request)
- type Config
- type DingResponse
- type Dingtalk
- type DingtalkReq
- type DingtalkReqTester
- type ExchangeWebService
- type HomeData
- type Mail
- type MailReq
- type MailTester
- type NotifierItem
- type NotifyConfig
- type NotifyConfigCache
- func (t *NotifyConfigCache) Delete(key string)
- func (t *NotifyConfigCache) Read(key string) *NotifyConfig
- func (t *NotifyConfigCache) ReadRedList() (redlist RedList)
- func (t *NotifyConfigCache) Walk(fn func(k string, v *NotifyConfig))
- func (t *NotifyConfigCache) Write(k string, v *NotifyConfig, persist bool) error
- func (t *NotifyConfigCache) WriteRedList(v RedList, persist bool) error
- type NotifyRsp
- type NotifyRspData
- type QcloudBase
- type QcloudSms
- type QcloudSmsReq
- type QcloudSmsReqTester
- type QcloudSmsRsp
- type QcloudSmsVoiceTester
- type QcloudVoice
- type QcloudVoiceReq
- type Qywx
- type QywxReq
- type QywxRsp
- type QywxTester
- type QywxTokenResult
- type RawNotifyConfig
- type RawQcloudSmsReq
- type RawQcloudSmsRspDetail
- type RawQcloudVoiceReq
- type RawQcloudVoiceRsp
- type RedList
- type RedListFilter
- type Request
- type Robot
- func (r Robot) SendActionCard(title, text, singleTitle, singleURL, btnOrient, hideAvatar string) (DingResponse, error)
- func (r Robot) SendLink(title, text, messageURL, picURL string) (DingResponse, error)
- func (r Robot) SendMarkdown(title, text string, atMobiles []string, isAtAll bool) (DingResponse, error)
- func (r Robot) SendText(content string, atMobiles []string, isAtAll bool) (DingResponse, error)
- type Roboter
- type Rsp
- type Sms
- type SmsNotifier
- type SmsReq
- type SmsTester
- type SnapshotService
- func (s SnapshotService) CleanAll()
- func (s SnapshotService) Delete(file string) error
- func (s *SnapshotService) Init(dir string) error
- func (s *SnapshotService) InitDefault() error
- func (s SnapshotService) Read(file string) ([]byte, error)
- func (s SnapshotService) RecoverCache(c *NotifyConfigCache) error
- func (s SnapshotService) Walk(fn func(file string, content []byte)) error
- func (s SnapshotService) Write(file string, content []byte) error
- type Tel
- type Tester
- type TopClient
Constants ¶
const ( BreakIterating = true ContinueIterating = false )
const DeletedAt = ".deletedAt."
Variables ¶
This section is empty.
Functions ¶
func AbbreviateValues ¶
func FilterSlice ¶
FilterSlice 根据m过滤切片slice,返回剩余项目
func GetQywxAccessToken ¶
GetQywxAccessToken 获得企业微信的令牌
func HandleHome ¶
func HandleRedlist ¶
func HandleRedlist(a *App) func(w http.ResponseWriter, r *http.Request)
func SendEWSEmail ¶
SendEWSEmail helper method to send Message
func TrimSpaceToLower ¶
func WriteErrorJSON ¶
func WriteErrorJSON(statusCode int, w http.ResponseWriter, v interface{}) error
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, v interface{}) error
Types ¶
type AlibabaAliqinFcSmsNumSendRequest ¶
type AlibabaAliqinFcSmsNumSendRequest struct { // 公共回传参数,在“消息返回”中会透传回该参数;举例:用户可以传入自己下级的会员ID, // 在消息返回时,该会员ID会包含在内,用户可以根据该会员ID识别是哪位会员使用了你的应用 Extend string `json:"extend"` // 短信接收号码。支持单个或多个手机号码,传入号码为11位手机号码,不能加0或+86。 // 群发短信需传入多个号码,以英文逗号分隔,一次调用最多传入200个号码。示例:18600000000,13911111111,13322222222 RecNum string `json:"rec_num"` // 短信签名,传入的短信签名必须是在阿里大鱼“管理中心-短信签名管理”中的可用签名。 // 如“阿里大鱼”已在短信签名管理中通过审核,则可传入”阿里大鱼“(传参时去掉引号)作为短信签名。 // 短信效果示例:【阿里大鱼】欢迎使用阿里大鱼服务。 SmsFreeSignName string `json:"sms_free_sign_name"` // 短信模板变量,传参规则{"key":"value"},key的名字须和申请模板中的变量名一致,多个变量之间以逗号隔开。 // 示例:针对模板“验证码${code},您正在进行${product}身份验证,打死不要告诉别人哦!”, // 传参时需传入{"code":"1234","product":"alidayu"} SmsParam string `json:"sms_param"` // 短信模板ID,传入的模板必须是在阿里大鱼“管理中心-短信模板管理”中的可用模板。示例:SMS_585014 SmsTemplateCode string `json:"sms_template_code"` // 短信类型,传入值请填写normal SmsType string `json:"sms_type"` }
Top API: alibaba.aliqin.fc.sms.num.send 详细参数请参考官方Api文档:https://api.alidayu.com/docs/api.htm?apiId=25450
func NewAlibabaAliqinFcSmsNumSendRequest ¶
func NewAlibabaAliqinFcSmsNumSendRequest() *AlibabaAliqinFcSmsNumSendRequest
func (*AlibabaAliqinFcSmsNumSendRequest) GetMethodName ¶
func (req *AlibabaAliqinFcSmsNumSendRequest) GetMethodName() string
func (*AlibabaAliqinFcSmsNumSendRequest) ParamsIsValid ¶
func (req *AlibabaAliqinFcSmsNumSendRequest) ParamsIsValid() error
type AlibabaRequest ¶
type AlidayuTester ¶
type AlidayuTester struct { Config AliyunDaYuSms `json:"config"` Data AliyunDaYuSmsReq `json:"data"` }
func (*AlidayuTester) FilterRedList ¶
func (r *AlidayuTester) FilterRedList(list redList) bool
func (AlidayuTester) Send ¶
func (r AlidayuTester) Send(app *App) NotifyRsp
type AliyunDaYuSms ¶
type AliyunDaYuSms struct { AppKey string `json:"appKey"` AppSecret string `json:"appSecret"` TemplateCode string `json:"templateCode"` SignName string `json:"signName" faker:"-"` }
AliyunDaYuSms 表示阿里云大于短信发送器
func (AliyunDaYuSms) ChannelName ¶
func (s AliyunDaYuSms) ChannelName() string
func (*AliyunDaYuSms) Config ¶
func (s *AliyunDaYuSms) Config(config string) error
Config 创建发送器,要求参数 config 是{AppKey}/{AppSecret}/{TemplateCode}/{SignName}的格式
func (AliyunDaYuSms) ConvertRequest ¶
func (s AliyunDaYuSms) ConvertRequest(r *SmsReq) Request
func (*AliyunDaYuSms) InitMeaning ¶
func (s *AliyunDaYuSms) InitMeaning()
func (AliyunDaYuSms) NewRequest ¶
func (s AliyunDaYuSms) NewRequest() Request
func (AliyunDaYuSms) Notify ¶
func (s AliyunDaYuSms) Notify(_ *App, request Request) NotifyRsp
Notify 发送短信 https://api.alidayu.com/doc2/apiDetail?apiId=25450
type AliyunDaYuSmsErrorRsp ¶
type AliyunDaYuSmsReq ¶
type AliyunDaYuSmsReq struct { TemplateCode string `json:"templateCode" faker:"-"` TemplateParams map[string]string `json:"templateParams"` SignName string `json:"signName" faker:"-"` Mobiles []string `json:"mobiles" faker:"china_mobile_number"` }
func (*AliyunDaYuSmsReq) FilterRedList ¶
func (a *AliyunDaYuSmsReq) FilterRedList(list redList) bool
type AliyunDaYuSmsRsp ¶
type AliyunDaYuSmsRsp struct { Response map[string]interface{} `json:"alibaba_aliqin_fc_sms_num_send_response"` AliyunDaYuSmsErrorRsp }
type AliyunSms ¶
type AliyunSms struct { AccessKeyID string `json:"accessKeyID"` AccessKeySecret string `json:"accessKeySecret"` TemplateCode string `json:"templateCode"` SignName string `json:"signName" faker:"-"` }
AliyunSms 表示阿里云短信发送器
func (AliyunSms) ChannelName ¶
func (*AliyunSms) Config ¶
Config 创建发送器,要求参数 config 是{accessKeyId}/{accessKeySecret}/{templateCode}/{signName}的格式
func (AliyunSms) ConvertRequest ¶
func (*AliyunSms) InitMeaning ¶
func (s *AliyunSms) InitMeaning()
func (AliyunSms) NewRequest ¶
type AliyunSmsReq ¶
type AliyunSmsReq struct { TemplateCode string `json:"templateCode" faker:"-"` TemplateParams map[string]string `json:"templateParams"` SignName string `json:"signName" faker:"-"` Mobiles []string `json:"mobiles" faker:"china_mobile_number"` }
func (*AliyunSmsReq) FilterRedList ¶
func (a *AliyunSmsReq) FilterRedList(list redList) bool
type AliyunSmsRsp ¶
type AliyunSmsRsp struct { OutID string `json:"outId"` Code string `json:"code"` // eg. OK 请求状态码。 返回OK代表请求成功。 其他错误码详见错误码列表。 Message string `json:"message"` // eg. OK 状态码的描述。 RequestID string `json:"requestID"` // eg. F655A8D5-B967-440B-8683-DAD6FF8DE990 请求ID。 BizID string `json:"bizID"` // eg. 900619746936498440^0, 发送回执ID,可根据该ID在接口QuerySendDetails中查询具体的发送状态。 }
type AliyunsmsTester ¶
type AliyunsmsTester struct { Config AliyunSms `json:"config"` Data AliyunSmsReq `json:"data"` }
func (*AliyunsmsTester) FilterRedList ¶
func (r *AliyunsmsTester) FilterRedList(list redList) bool
func (AliyunsmsTester) Send ¶
func (r AliyunsmsTester) Send(app *App) NotifyRsp
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) DeleteConfig ¶
func (*App) NotifyByConfig ¶
func (*App) NotifyByConfigID ¶
func (*App) PostConfig ¶
func (*App) ServeByConfig ¶
type Config ¶
type DingResponse ¶
type Dingtalk ¶
type Dingtalk struct {
AccessToken string `json:"accessToken"`
}
Dingtalk 表示钉钉消息发送器
func (Dingtalk) ChannelName ¶
func (*Dingtalk) InitMeaning ¶
func (s *Dingtalk) InitMeaning()
func (Dingtalk) NewRequest ¶
type DingtalkReq ¶
type DingtalkReq struct { Message string `json:"message"` AtMobiles []string `json:"atMobiles" faker:"china_mobile_number"` AtAll bool `json:"atAll"` }
func (*DingtalkReq) FilterRedList ¶
func (s *DingtalkReq) FilterRedList(list redList) bool
type DingtalkReqTester ¶
type DingtalkReqTester struct { Config Dingtalk `json:"config"` Data DingtalkReq `json:"data"` }
func (*DingtalkReqTester) FilterRedList ¶
func (r *DingtalkReqTester) FilterRedList(list redList) bool
func (DingtalkReqTester) Send ¶
func (r DingtalkReqTester) Send(app *App) NotifyRsp
type ExchangeWebService ¶
type ExchangeWebService struct { EwsAddr string `json:"ewsAddr"` Username string `json:"username"` Password string `json:"password" ` }
ExchangeWebService is Exchange Web Service
func (ExchangeWebService) ChannelName ¶
func (q ExchangeWebService) ChannelName() string
func (*ExchangeWebService) Config ¶
func (q *ExchangeWebService) Config(config string) error
Config 加载配置
func (*ExchangeWebService) InitMeaning ¶
func (q *ExchangeWebService) InitMeaning()
func (ExchangeWebService) NewRequest ¶
func (q ExchangeWebService) NewRequest() Request
type HomeData ¶
type HomeData struct { Sha1ver string BuildTime string Items []NotifierItem }
type Mail ¶
type Mail struct { SMTPAddr string `json:"smtpAddr"` // smtp.gmail.com SMTPPort int `json:"smtpPort"` // 587 From string `json:"from" faker:"email"` // ...@gmail.com Username string `json:"username"` // ... Pass string `json:"pass"` // ... }
Mail 表示邮件发送器
func (Mail) ChannelName ¶
func (*Mail) InitMeaning ¶
func (q *Mail) InitMeaning()
func (Mail) NewRequest ¶
type MailReq ¶
type MailReq struct { Subject string `json:"subject"` Message string `json:"message"` To []string `json:"to" faker:"email"` }
func (*MailReq) FilterRedList ¶
type MailTester ¶
func (*MailTester) FilterRedList ¶
func (r *MailTester) FilterRedList(list redList) bool
func (MailTester) Send ¶
func (r MailTester) Send(app *App) NotifyRsp
type NotifierItem ¶
type NotifyConfig ¶
func ParseNotifyConfig ¶
func ParseNotifyConfig(content []byte) (*NotifyConfig, error)
type NotifyConfigCache ¶
type NotifyConfigCache struct { C *cache.Cache Snapshot SnapshotService // contains filtered or unexported fields }
func NewCache ¶
func NewCache(snapshotDir string) *NotifyConfigCache
func (*NotifyConfigCache) Delete ¶
func (t *NotifyConfigCache) Delete(key string)
func (*NotifyConfigCache) Read ¶
func (t *NotifyConfigCache) Read(key string) *NotifyConfig
func (*NotifyConfigCache) ReadRedList ¶
func (t *NotifyConfigCache) ReadRedList() (redlist RedList)
func (*NotifyConfigCache) Walk ¶
func (t *NotifyConfigCache) Walk(fn func(k string, v *NotifyConfig))
func (*NotifyConfigCache) Write ¶
func (t *NotifyConfigCache) Write(k string, v *NotifyConfig, persist bool) error
func (*NotifyConfigCache) WriteRedList ¶
func (t *NotifyConfigCache) WriteRedList(v RedList, persist bool) error
type NotifyRsp ¶
type NotifyRsp struct { Status int `json:"status"` // 状态,0成功 Message string `json:"message"` // 消息 Data NotifyRspData `json:"data"` // 原始返回 }
type NotifyRspData ¶
type NotifyRspData struct { Channel string `json:"channel"` // 发送渠道 Raw interface{} `json:"raw"` }
type QcloudBase ¶
func (QcloudBase) CreateSignature ¶
func (q QcloudBase) CreateSignature(rand string, t int64, nums ...string) string
type QcloudSms ¶
type QcloudSms struct { QcloudBase TplID int `json:"tplID"` Sign string `json:"sign" faker:"-"` TmplVarNames []string `json:"tmplVarNames"` }
QcloudSms 表示腾讯云短信发送器
func (QcloudSms) ChannelName ¶
func (QcloudSms) ConvertRequest ¶
func (*QcloudSms) InitMeaning ¶
func (q *QcloudSms) InitMeaning()
func (QcloudSms) NewRequest ¶
type QcloudSmsReq ¶
type QcloudSmsReq struct { Params []string `json:"params"` Mobiles []string `json:"mobiles" faker:"china_mobile_number"` }
func (*QcloudSmsReq) FilterRedList ¶
func (q *QcloudSmsReq) FilterRedList(list redList) bool
type QcloudSmsReqTester ¶
type QcloudSmsReqTester struct { Config QcloudSms `json:"config"` Data QcloudSmsReq `json:"data"` }
func (*QcloudSmsReqTester) FilterRedList ¶
func (r *QcloudSmsReqTester) FilterRedList(list redList) bool
func (QcloudSmsReqTester) Send ¶
func (r QcloudSmsReqTester) Send(app *App) NotifyRsp
type QcloudSmsRsp ¶
type QcloudSmsRsp struct { Result int `json:"result"` Errmsg string `json:"errmsg"` Ext string `json:"ext"` Detail []RawQcloudSmsRspDetail `json:"detail"` }
type QcloudSmsVoiceTester ¶
type QcloudSmsVoiceTester struct { Config QcloudVoice `json:"config"` Data QcloudVoiceReq `json:"data"` }
func (*QcloudSmsVoiceTester) FilterRedList ¶
func (r *QcloudSmsVoiceTester) FilterRedList(list redList) bool
func (QcloudSmsVoiceTester) Send ¶
func (r QcloudSmsVoiceTester) Send(app *App) NotifyRsp
type QcloudVoice ¶
type QcloudVoice struct { QcloudBase TplID int `json:"tplID"` PlayTimes int `json:"playTimes" faker:"enum=1/2/3"` TmplVarNames []string `json:"tmplVarNames"` }
QcloudVoice 表示腾讯语音短信发送器
func (QcloudVoice) ChannelName ¶
func (s QcloudVoice) ChannelName() string
func (QcloudVoice) ConvertRequest ¶
func (s QcloudVoice) ConvertRequest(r map[string]string) []string
func (*QcloudVoice) InitMeaning ¶
func (s *QcloudVoice) InitMeaning()
func (QcloudVoice) NewRequest ¶
func (s QcloudVoice) NewRequest() Request
type QcloudVoiceReq ¶
type QcloudVoiceReq struct { Params map[string]string `json:"params"` Mobile string `json:"mobile" faker:"china_mobile_number"` }
func (*QcloudVoiceReq) FilterRedList ¶
func (q *QcloudVoiceReq) FilterRedList(list redList) bool
type Qywx ¶
type Qywx struct { CorpID string `json:"corpID"` CorpSecret string `json:"corpSecret"` AgentID string `json:"agentID"` }
Qywx 表示企业微信消息发送器
func (Qywx) ChannelName ¶
func (*Qywx) InitMeaning ¶
func (s *Qywx) InitMeaning()
func (Qywx) NewRequest ¶
type QywxReq ¶
func (*QywxReq) FilterRedList ¶
type QywxRsp ¶
type QywxRsp struct { Errocode int `json:"errcode"` Errmsg string `json:"errmsg"` Invaliduser string `json:"invaliduser"` Invalidparty string `json:"invalidparty"` Invalidtag string `json:"invalidtag"` }
func FastSendQywxMsg ¶
func FastSendQywxMsg(corpID, corpSecret, agentID, content string, userIds []string) (QywxRsp, error)
FastSendQywxMsg 快速发送企业微信消息
func SendQywxMsg ¶
https://qydev.weixin.qq.com/wiki/index.php?title=发送接口说明 SendQywxMsg 发送企业微信消息
type QywxTester ¶
func (*QywxTester) FilterRedList ¶
func (r *QywxTester) FilterRedList(list redList) bool
func (QywxTester) Send ¶
func (r QywxTester) Send(app *App) NotifyRsp
type QywxTokenResult ¶
type QywxTokenResult struct { ErrCode int `json:"errcode"` ErrMsg string `json:"errmsg"` AccessToken string `json:"access_token"` ExpiresInSeconds int `json:"expires_in"` }
QywxTokenResult 表示企业微信的令牌结果
type RawNotifyConfig ¶
type RawNotifyConfig struct { Type string `json:"type"` Config json.RawMessage `json:"config"` }
func (RawNotifyConfig) ParseConfig ¶
func (r RawNotifyConfig) ParseConfig() (Config, error)
type RawQcloudSmsReq ¶
type RawQcloudSmsReq struct { Ext string `json:"ext"` // 用户的 session 内容,腾讯 server 回包中会原样返回,可选字段,不需要就填空 Params []string `json:"params"` // 模板参数,若模板没有参数,请提供为空数组 Sig string `json:"sig"` // App 凭证,计算公式:sha256(appkey=$appkey&random=$random&time=$time&mobile=$mobile) Sign string `json:"sign" faker:"-"` // 短信签名,如果使用默认签名,该字段可缺省 Tel []Tel `json:"tel"` Time int64 `json:"time"` // 请求发起时间,UNIX 时间戳(单位:秒),如果和系统时间相差超过 10 分钟则会返回失败 TplID int `json:"tpl_id"` // 模板 ID,在控制台审核通过的模板 ID }
RawQcloudSmsReq 表示腾讯云短消息请求体结构
type RawQcloudSmsRspDetail ¶
type RawQcloudVoiceReq ¶
type RawQcloudVoiceReq struct { TplID int `json:"tpl_id"` // 模板 ID,在控制台审核通过的模板 ID Params []string `json:"params"` // 模板参数,若模板没有参数,请提供为空数组 PlayTimes int `json:"playtimes" faker:"enum=1/2/3"` // 播放次数,可选,最多3次,默认2次。 Sig string `json:"sig"` // App 凭证,计算公式:sha256(appkey=$appkey&random=$random&time=$time&mobile=$mobile) Tel Tel `json:"tel"` Time int64 `json:"time"` // 请求发起时间,UNIX 时间戳(单位:秒),如果和系统时间相差超过 10 分钟则会返回失败 Ext string `json:"ext"` // 用户的 session 内容,腾讯 server 回包中会原样返回,可选字段,不需要就填空 }
RawQcloudVoiceReq 表示腾讯云语音短信请求体结构
type RawQcloudVoiceRsp ¶
type RedList ¶
type RedList struct { Mobiles []string `json:"mobiles"` Mails []string `json:"mails"` QywxUserIds []string `json:"qywxUserIds"` }
RedList 表示红名单,红名单里面配置的人,不可以被“骚扰”
type RedListFilter ¶
type RedListFilter interface { // FilterRedList 过滤,返回true表示还有剩余项目 FilterRedList(list redList) bool }
type Request ¶
type Request interface { RedListFilter }
type Robot ¶
type Robot struct {
Webhook string
}
Robot represents a dingtalk custom robot that can send messages to groups.
func (Robot) SendActionCard ¶
func (r Robot) SendActionCard(title, text, singleTitle, singleURL, btnOrient, hideAvatar string) (DingResponse, error)
SendActionCard send a action card type message.
func (Robot) SendLink ¶
func (r Robot) SendLink(title, text, messageURL, picURL string) (DingResponse, error)
SendLink send a link type message.
func (Robot) SendMarkdown ¶
func (r Robot) SendMarkdown(title, text string, atMobiles []string, isAtAll bool) (DingResponse, error)
SendMarkdown send a markdown type message.
type Roboter ¶
type Roboter interface { SendText(content string, atMobiles []string, isAtAll bool) (*DingResponse, error) SendLink(title, text, messageURL, picURL string) (*DingResponse, error) SendMarkdown(title, text string, atMobiles []string, isAtAll bool) (*DingResponse, error) SendActionCard(title, text, singleTitle, singleURL, btnOrientation, hideAvatar string) (*DingResponse, error) }
Roboter is the interface implemented by Robot that can send multiple types of messages.
type Sms ¶
type Sms struct { ConfigIds []string `json:"configIds"` Random bool `json:"random"` // 是否在发送配置中随机发送,不随机时,按照配置顺序发送 Retry int `json:"retry" faker:"-"` // 在发送配置中,重试n次 }
Sms 表示聚合短信发送器
func (Sms) ChannelName ¶
func (*Sms) Config ¶
Config 创建发送器,要求参数 config 是{accessKeyId}/{accessKeySecret}/{templateCode}/{signName}的格式
func (*Sms) InitMeaning ¶
func (r *Sms) InitMeaning()
func (Sms) NewRequest ¶
type SmsNotifier ¶
type SmsReq ¶
type SmsReq struct { TemplateParams map[string]string `json:"templateParams"` Mobiles []string `json:"mobiles" faker:"china_mobile_number"` Retry int `json:"retry" faker:"-"` // 在发送配置中,重试n次, -1表示使用默认配置 }
func (*SmsReq) FilterRedList ¶
type SmsTester ¶
func (*SmsTester) FilterRedList ¶
type SnapshotService ¶
type SnapshotService struct {
Dir string
}
func (SnapshotService) CleanAll ¶
func (s SnapshotService) CleanAll()
func (SnapshotService) Delete ¶
func (s SnapshotService) Delete(file string) error
func (*SnapshotService) Init ¶
func (s *SnapshotService) Init(dir string) error
func (*SnapshotService) InitDefault ¶
func (s *SnapshotService) InitDefault() error
func (SnapshotService) RecoverCache ¶
func (s SnapshotService) RecoverCache(c *NotifyConfigCache) error
type Tel ¶
type Tel struct { Mobile string `json:"mobile" faker:"china_mobile_number"` NationCode string `json:"nationcode"` }
Tel 表示电话号码
type Tester ¶
type Tester interface { RedListFilter Send(*App) NotifyRsp }