Documentation
¶
Index ¶
- Constants
- func FeishuSendCommMsg(alert *dropbox.AlertPostCommApi) error
- func FeishuSendCommMsgV2(alert *dropbox.CommonAlert, groups []interface{}) error
- func InitFeishuBot()
- type FeishuBatchGetIdResponse
- type FeishuCert
- func (c *FeishuCert) FeishuMsgBatchSendWithPost(ops dropbox.AlertPostCommApi, users []string) error
- func (c *FeishuCert) FeishuMsgCardBatchSend(content *string, chatids []string) error
- func (c *FeishuCert) GetToken() (string, error)
- func (c *FeishuCert) GetUserId(params map[string][]string) []string
- func (c *FeishuCert) TokenHeader() (*http.HeaderOption, error)
- type FeishuMsgPostBatchSend
- type FeishuTokenRespon
- type FeishuUserBatchData
- type FeishuUserData
- type MsgCardRequest
- type MsgCardResponse
Constants ¶
View Source
const ( // 自建应用如下,应用商店应用去掉internal/ FeishuTenantAccessToken = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal/" FeishuBatchGetId = "https://open.feishu.cn/open-apis/user/v1/batch_get_id" FeishuMsgSend = "https://open.feishu.cn/open-apis/message/v4/send/" FeishuMsgBatchSend = "https://open.feishu.cn/open-apis/message/v4/batch_send/" )
Variables ¶
This section is empty.
Functions ¶
func FeishuSendCommMsg ¶
func FeishuSendCommMsg(alert *dropbox.AlertPostCommApi) error
func FeishuSendCommMsgV2 ¶
func FeishuSendCommMsgV2(alert *dropbox.CommonAlert, groups []interface{}) error
func InitFeishuBot ¶
func InitFeishuBot()
Types ¶
type FeishuBatchGetIdResponse ¶
type FeishuBatchGetIdResponse struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data FeishuUserBatchData `json:"data"`
}
type FeishuCert ¶
func (*FeishuCert) FeishuMsgBatchSendWithPost ¶
func (c *FeishuCert) FeishuMsgBatchSendWithPost(ops dropbox.AlertPostCommApi, users []string) error
func (*FeishuCert) FeishuMsgCardBatchSend ¶
func (c *FeishuCert) FeishuMsgCardBatchSend(content *string, chatids []string) error
func (*FeishuCert) GetToken ¶
func (c *FeishuCert) GetToken() (string, error)
func (*FeishuCert) TokenHeader ¶
func (c *FeishuCert) TokenHeader() (*http.HeaderOption, error)
type FeishuMsgPostBatchSend ¶
type FeishuMsgPostBatchSend struct {
Users []string `json:"user_ids"`
MsgType string `json:"msg_type"`
Content map[string]string `json:"content"`
}
func OpsApiDataToFeishuBatchTemp ¶
func OpsApiDataToFeishuBatchTemp(ops dropbox.AlertPostCommApi, users []string) *FeishuMsgPostBatchSend
type FeishuTokenRespon ¶
type FeishuUserBatchData ¶
type FeishuUserBatchData struct {
Emails map[string][]*FeishuUserData `json:"email_users"`
EmailNotExist []string `json:"emails_not_exist"`
Mobiles map[string][]*FeishuUserData `json:"mobile_users"`
MobileNotExist []string `json:"mobiles_not_exist"`
}
type FeishuUserData ¶
type MsgCardRequest ¶
type MsgCardRequest struct {
ChatId string `json:"chat_id"`
Card map[string]interface{} `json:"card"`
MsgType string `json:"msg_type"` //interactive"
}
res, err := customBot.CommSendPostMsg(url)
logger.Infof("{\"信息内容\":\"%s\",\"请求返回是\":\"%s\"}", *content, res)
//alert.ReportCC() 暂停统计
if err != nil {
logger.Error("send msg to group failed by ", err, " group is ", group)
errors = append(errors, err)
continue
//异常组发送失败不退出,继续执行
//return res, err
}
type MsgCardResponse ¶
Click to show internal directories.
Click to hide internal directories.