imnotify

package
v2.2.0-20240131 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WeChatWorkType                  = "wechat"
	MarkdownColorInfo               = "info"
	MarkdownColorComment            = "comment"
	MarkdownColorWarning            = "warning"
	WeChatTextTypeText     TextType = "text"
	WeChatTextTypeMarkdown TextType = "markdown"
)

Variables

This section is empty.

Functions

func GetColorTemplateWithStatus

func GetColorTemplateWithStatus(status config.Status) string

Types

type Action

type Action struct {
	Tag  string   `json:"tag"`
	Text TextElem `json:"text"`
	Type string   `json:"type"`
	URL  string   `json:"url"`
}

type Config

type Config struct {
	WideScreenMode bool `json:"wide_screen_mode"`
}

type DingDingAt

type DingDingAt struct {
	AtMobiles []string `json:"atMobiles"`
	IsAtAll   bool     `json:"isAtAll"`
}

type DingDingMarkDown

type DingDingMarkDown struct {
	Title string `json:"title"`
	Text  string `json:"text"`
}

type DingDingMessage

type DingDingMessage struct {
	MsgType  string            `json:"msgtype"`
	MarkDown *DingDingMarkDown `json:"markdown"`
	At       *DingDingAt       `json:"at"`
}

type FeiShuContentV2

type FeiShuContentV2 struct {
	Text string `json:"text"`
}

type FeiShuMessage

type FeiShuMessage struct {
	Title string `json:"title"`
	Text  string `json:"text"`
}

type FeiShuMessageV2

type FeiShuMessageV2 struct {
	MsgType string          `json:"msg_type"`
	Content FeiShuContentV2 `json:"content"`
}

type Field

type Field struct {
	IsShort bool     `json:"is_short"`
	Text    TextElem `json:"text"`
}
type Header struct {
	Template string `json:"template"`
	Title    Title  `json:"title"`
}

type I18NElements

type I18NElements struct {
	ZhCn []*ZhCn `json:"zh_cn"`
}

type IMNotifyService

type IMNotifyService struct {
	// contains filtered or unexported fields
}

func NewIMNotifyClient

func NewIMNotifyClient() *IMNotifyService

func (*IMNotifyService) SendDingDingMessage

func (w *IMNotifyService) SendDingDingMessage(uri, title, content string, atMobiles []string, isAtAll bool) error

func (*IMNotifyService) SendFeishuMessage

func (w *IMNotifyService) SendFeishuMessage(uri string, lcMsg *LarkCard) error

func (*IMNotifyService) SendFeishuMessageOfSingleType

func (w *IMNotifyService) SendFeishuMessageOfSingleType(title, uri, content string) error

func (*IMNotifyService) SendMessageRequest

func (w *IMNotifyService) SendMessageRequest(uri string, message interface{}) ([]byte, error)

func (*IMNotifyService) SendWeChatWorkMessage

func (w *IMNotifyService) SendWeChatWorkMessage(textType TextType, uri, content string) error

type IMNotifyType

type IMNotifyType string
const (
	IMNotifyTypeDingDing IMNotifyType = "dingding"
	IMNotifyTypeWeChat   IMNotifyType = "wechat"
	IMNotifyTypeLark     IMNotifyType = "feishu"
)

type LarkCard

type LarkCard struct {
	Config       *Config       `json:"config"`
	Header       *Header       `json:"header"`
	I18NElements *I18NElements `json:"i18n_elements"`
}

func NewLarkCard

func NewLarkCard() *LarkCard

func (*LarkCard) AddI18NElementsZhcnAction

func (lc *LarkCard) AddI18NElementsZhcnAction(content, url string)

func (*LarkCard) AddI18NElementsZhcnFeild

func (lc *LarkCard) AddI18NElementsZhcnFeild(content string, isCreatefield bool)

func (*LarkCard) SetConfig

func (lc *LarkCard) SetConfig(wideScreenMode bool)

func (*LarkCard) SetHeader

func (lc *LarkCard) SetHeader(template, title, tag string)

type LarkCardReq

type LarkCardReq struct {
	MsgType string    `json:"msg_type"`
	Card    *LarkCard `json:"card"`
}

type Markdown

type Markdown struct {
	Content string `json:"content"`
}

type Messsage

type Messsage struct {
	MsgType string `json:"msgtype"`
	Text    *Text  `json:"markdown"`
}

type Text

type Text struct {
	Content string `json:"content"`
}

type TextElem

type TextElem struct {
	Content string `json:"content"`
	Tag     string `json:"tag"`
}

type TextType

type TextType string

type Title

type Title struct {
	Content string `json:"content"`
	Tag     string `json:"tag"`
}

type WeChatWorkCard

type WeChatWorkCard struct {
	MsgType  string   `json:"msgtype"`
	Markdown Markdown `json:"markdown"`
}

type ZhCn

type ZhCn struct {
	Fields  []*Field  `json:"fields,omitempty"`
	Tag     string    `json:"tag"`
	Actions []*Action `json:"actions,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL