instantmessage

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

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

type BranchTagType

type BranchTagType string
const (
	BranchTagTypeBranch      BranchTagType = "Branch"
	BranchTagTypeTag         BranchTagType = "Tag"
	CommitMsgInterceptLength               = 60
)

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 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 Service

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

func NewWeChatClient

func NewWeChatClient() *Service

func (*Service) SendInstantMessage

func (w *Service) SendInstantMessage(task *task.Task, testTaskStatusChanged, scanningTaskStatusChanged bool) error

func (*Service) SendMessageRequest

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

func (*Service) SendWeChatWorkMessage

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

func (*Service) SendWorkflowTaskAproveNotifications

func (w *Service) SendWorkflowTaskAproveNotifications(workflowName string, taskID int64) error

func (*Service) SendWorkflowTaskNotifications

func (w *Service) SendWorkflowTaskNotifications(task *models.WorkflowTask) error

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