Documentation ¶
Overview ¶
* * @Description:移动短信 e.g.
cmSms := ChinaMobileSms{ TemplateId:"", Mobiles:"", Params:"", }
cmSms.Send()
* * @Description:一信通平台发短信
* 使用示例:
var dd = notify.DingDing{ ApiUrl: "https://oapi.dingtalk.com/robot/send?access_token=xxxxx", Content: "xx接口异常通知测试", } _,err := dd.Send()
*
- @Description telegram notify
- @Author $
- @Date $ $ *
* * @Description:邮件发送
/* 例:
var dd = ¬ify.Email{ EmailTo: []string{"ww@qq.cn",}, Subject: "发件测试", Body: "发件内容", }
res,err := dd.Send() fmt.Println(res,err)
* * @Description:阿里云发短信
*
- @Description telegram notify *
Index ¶
- func Discord(title, content string)
- func InitConfig(config string)
- func NotifyAll(title, message string, token ...string)
- func PushPlus(title, content string, token ...string)
- func Telegram(text string)
- type AliSms
- type ChinaMobileSms
- type ChinaUnicomSms
- type DingDing
- type DingDingTextContent
- type Email
- type KV
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶
func InitConfig(config string)
Types ¶
type AliSms ¶
type AliSms struct { PhoneNumberJson string //电话号码 ["1590000****","1350000****"] SignNameJson string //短信签名名称,JSON数组格式。 TemplateCode string //短信模板CODE。如 SMS_152550005 TemplateParamJson string //短信模板变量对应的实际值,JSON格式。 [{"name":"TemplateParamJson"},{"name":"TemplateParamJson"}] SmsUpExtendCodeJson string //上行短信扩展码,JSON数组格式。无特殊需要此字段的用户请忽略此字段。 // contains filtered or unexported fields }
func (*AliSms) Send ¶
func (srv *AliSms) Send(templateCode string) (aliSmsResult *dysmsapi20170525.SendBatchSmsResponse, err error)
发送短信, templateCode模板编码(默认调用配置中的)
type ChinaMobileSms ¶
type ChinaMobileSms struct { TemplateId string `json:"templateId"` //模板ID Mobiles string `json:"mobiles"` //收信手机号码。英文逗号分隔,每批次限5000个号码,例:“13800138000,13800138001,13800138002”。 Params string `json:"params"` //模板变量。格式:[“param1”,“param2”],无变量模板填[""]。 }
func (*ChinaMobileSms) Send ¶
func (srv *ChinaMobileSms) Send() error
type ChinaUnicomSms ¶
type ChinaUnicomSms struct { PhoneNumberJson string //电话号码 ["1590000****","1350000****"] TemplateCode string //短信模板CODE。如 SMS_152550005 TemplateParamJson string //短信模板变量对应的实际值,JSON格式。 [{"name":"TemplateParamJson"},{"name":"TemplateParamJson"}] }
func (*ChinaUnicomSms) Send ¶
func (srv *ChinaUnicomSms) Send() (aliSmsResult *dysmsapi20170525.SendBatchSmsResponse, err error)
发送短信, templateCode模板编码(默认调用配置中的) 如果短信模板没有备案,则http状态码为505 接口有限制调用方IP
type DingDing ¶
type DingDingTextContent ¶
type DingDingTextContent struct {
Content string `json:"content"`
}
Click to show internal directories.
Click to hide internal directories.