Files
vRp.CD2g_test/notify/senders
2024-01-15 17:27:02 +08:00
..
2023-06-12 11:30:08 +08:00
2024-01-15 11:49:48 +08:00
2023-06-13 16:14:29 +08:00
2024-01-15 17:27:02 +08:00

Senders

Go doc

senders Package 包含了内置通知发送器的实现

目录导航

列出了该 package 下所有的函数及类型定义,可通过目录导航进行快捷跳转 ❤️

展开 / 折叠目录导航

包级函数定义

函数名称 描述
NewFeiShu 根据特定的 webhook 地址创建飞书发送器

类型定义

类型 名称 描述
STRUCT FeiShu 飞书发送器

详情信息

func NewFeiShu(webhook string) *FeiShu

根据特定的 webhook 地址创建飞书发送器


FeiShu STRUCT

飞书发送器

type FeiShu struct {
	client  *resty.Client
	webhook string
}

func (*FeiShu) Push(notify notify.Notify) error

推送通知

查看 / 收起单元测试

func TestFeiShu_Push(t *testing.T) {
	fs := NewFeiShu("https://open.feishu.cn/open-apis/bot/v2/hook/bid")
	rt := notifies.NewFeiShu(notifies.FeiShuMessageWithRichText(notifies.NewFeiShuRichText().Create("zh_cn", "标题咯").AddText("哈哈哈").Ok()))
	if err := fs.Push(rt); err != nil {
		panic(err)
	}
}