Documentation
¶
Index ¶
Constants ¶
View Source
const ( ElementType_Content = "content" ElementType_Hr = "hr" ElementType_Image = "image" ElementType_Action = "action" ElementType_Note = "note" )
View Source
const (
CardMessage = "interactive"
)
View Source
const (
URL_PREFIX = "https://open.feishu.cn/open-apis/bot"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card struct { Config *CardConfig `json:"config"` Header *CardHeader `json:"header"` Elements []interface{} `json:"elements"` }
card说明: https://open.feishu.cn/document/ukTMukTMukTM/ugTNwUjL4UDM14CO1ATN card可视化工具: https://open.feishu.cn/tool/cardbuilder?from=custom_bot_doc
type CardConfig ¶
type CardConfig struct { WideScreenMode bool `json:"wide_screen_mode"` EnableForward bool `json:"enable_forward"` }
card config说明: https://open.feishu.cn/document/ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN
type CardHeader ¶
card header说明: https://open.feishu.cn/document/ukTMukTMukTM/ukTNwUjL5UDM14SO1ATN
type Color ¶
type Color string
const ( COLOR_BLUE Color = "blue" COLOR_WATHET Color = "wathet" COLOR_TURQUOISE Color = "turquoise" COLOR_GREEN Color = "green" COLOR_YELLOW Color = "yellow" COLOR_ORANGE Color = "orange" COLOR_RED Color = "red" COLOR_CARMINE Color = "carmine" COLOR_VIOLET Color = "violet" COLOR_PURPLE Color = "purple" COLOR_INDIGO Color = "indigo" COLOR_GREY Color = "grey" )
type ContentElement ¶
type ContentElement struct { Tag string `json:"tag"` Text *Text `json:"text"` Fields []*Field `json:"fields"` }
car element说明: https://open.feishu.cn/document/ukTMukTMukTM/uEjNwUjLxYDM14SM2ATN
func NewFiledMarkdownContent ¶
func NewFiledMarkdownContent(fileds []*NotifyFiled) *ContentElement
func NewMarkdownContent ¶
func NewMarkdownContent(content string) *ContentElement
type ElementType ¶
type ElementType string
type FiledGroup ¶
type FiledGroup struct { EndType FiledGroupEndType Items []*NotifyFiled }
func NewEndHrGroup ¶
func NewEndHrGroup(fileds []*NotifyFiled) *FiledGroup
func NewEndNoneGroup ¶
func NewEndNoneGroup() *FiledGroup
func (*FiledGroup) Add ¶
func (g *FiledGroup) Add(f *NotifyFiled)
type FiledGroupEndType ¶
type FiledGroupEndType string
const ( FiledGroupEndType_None FiledGroupEndType = "none" FiledGroupEndType_Hr FiledGroupEndType = "hr" FiledGroupEndType_Line FiledGroupEndType = "line" )
type HrElement ¶
type HrElement struct {
Tag string `json:"tag"`
}
func NewHrElement ¶
func NewHrElement() *HrElement
type Message ¶
type Message struct { MsgType MessageType `json:"msg_type"` Card Card `json:"card"` }
https://www.feishu.cn/hc/zh-CN/articles/360024984973 默认使用飞书的card数据模式
func NewCardMessage ¶
func NewCardMessage(m *NotifyMessage) *Message
如何寻找emoji字符: https://emojipedia.org/light-bulb/
type MessageType ¶
type MessageType string
type NoteElement ¶
https://open.feishu.cn/document/ukTMukTMukTM/ucjNwUjL3YDM14yN2ATN
func NewNoteContent ¶
func NewNoteContent(fileds []string) *NoteElement
type NotifyFiled ¶
func NewNotifyFiled ¶
func NewNotifyFiled(key, value string, short bool) *NotifyFiled
func (*NotifyFiled) FiledFormat ¶
func (f *NotifyFiled) FiledFormat() string
type NotifyMessage ¶
type NotifyMessage struct { Title string Content string RobotURL string FiledGroup []*FiledGroup Note []string Color Color }
func NewFiledMarkdownMessage ¶
func NewFiledMarkdownMessage(robotURL, title string, color Color, groups ...*FiledGroup) *NotifyMessage
func NewMarkdownNotifyMessage ¶
func NewMarkdownNotifyMessage(robotURL, title, content string) *NotifyMessage
func (*NotifyMessage) AddFiledGroup ¶
func (m *NotifyMessage) AddFiledGroup(group *FiledGroup)
func (*NotifyMessage) AddNote ¶
func (m *NotifyMessage) AddNote(n string)
func (*NotifyMessage) HasFiledGroup ¶
func (m *NotifyMessage) HasFiledGroup() bool
func (*NotifyMessage) HasNote ¶
func (m *NotifyMessage) HasNote() bool
Click to show internal directories.
Click to hide internal directories.