dingtalk

package module
v0.0.0-...-175be1e Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

README

dingtalk

golang钉钉机器人客户端

Documentation

Index

Constants

View Source
const (
	TEXT        msgTypeType = "text"       //text类型
	LINK        msgTypeType = "link"       //link类型
	MARKDOWN    msgTypeType = "markdown"   //markdown类型
	ACTION_CARD msgTypeType = "actionCard" //ActionCard类型
	FEED_CARD   msgTypeType = "feedCard"   //FeedCard类型
)

Variables

This section is empty.

Functions

func DingMap

func DingMap() *dingMap

func NewActionCardMsg

func NewActionCardMsg(title, text string, opts ...actionCardOption) *actionCardMsg

func NewDTMDMsg

func NewDTMDMsg(title string, dtmdMap *dingMap, opts ...atOption) *markDownMsg

func NewFeedCardMsg

func NewFeedCardMsg(feedCard []FeedCardLinkModel) *feedCardMsg

func NewLinkMsg

func NewLinkMsg(title, text, picUrl, msgUrl string) *linkMsg

func NewMarkDownMsg

func NewMarkDownMsg(title string, text interface{}, opts ...atOption) *markDownMsg

func NewTextMsg

func NewTextMsg(content string, opts ...atOption) *textMsg

func WithAtAll

func WithAtAll() atOption

func WithAtMobiles

func WithAtMobiles(mobiles []string) atOption

func WithCardBtnVertical

func WithCardBtnVertical() actionCardOption

func WithCardBtns

func WithCardBtns(btns []ActionCardMultiBtnModel) actionCardOption

func WithCardSingleTitle

func WithCardSingleTitle(title string) actionCardOption

func WithCardSingleURL

func WithCardSingleURL(url string) actionCardOption

Types

type ActionCardMultiBtnModel

type ActionCardMultiBtnModel struct {
	Title     string `json:"title,omitempty"`
	ActionURL string `json:"actionURL,omitempty"`
}

type DingTalk

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

func InitDingTalk

func InitDingTalk(tokens []string, key string) *DingTalk

func InitDingTalkWithSecret

func InitDingTalkWithSecret(tokens string, secret string) *DingTalk

func (*DingTalk) SendActionCardMessage

func (d *DingTalk) SendActionCardMessage(title, text string, opts ...actionCardOption) error

func (*DingTalk) SendActionCardMessageBySlice

func (d *DingTalk) SendActionCardMessageBySlice(title string, textList []string, opts ...actionCardOption) error

func (*DingTalk) SendDTMDMessage

func (d *DingTalk) SendDTMDMessage(title string, dtmdMap *dingMap, opt ...atOption) error

利用dtmd发送点击消息

func (*DingTalk) SendFeedCardMessage

func (d *DingTalk) SendFeedCardMessage(feedCard []FeedCardLinkModel) error

func (*DingTalk) SendLinkMessage

func (d *DingTalk) SendLinkMessage(title, text, picUrl, msgUrl string) error

func (*DingTalk) SendMarkDownMessage

func (d *DingTalk) SendMarkDownMessage(title, text string, opts ...atOption) error

func (DingTalk) SendMarkDownMessageBySlice

func (d DingTalk) SendMarkDownMessageBySlice(title string, textList []string, opts ...atOption) error

func (*DingTalk) SendTextMessage

func (d *DingTalk) SendTextMessage(content string, opt ...atOption) error

type FeedCardLinkModel

type FeedCardLinkModel struct {
	Title      string `json:"title,omitempty"`
	MessageURL string `json:"messageURL,omitempty"`
	PicURL     string `json:"picURL,omitempty"`
}

type MarkType

type MarkType string
const (
	H1    MarkType = "h1"
	H2    MarkType = "h2"
	H3    MarkType = "h3"
	H4    MarkType = "h4"
	H5    MarkType = "h5"
	H6    MarkType = "h6"
	RED   MarkType = "red"
	BLUE  MarkType = "blue"
	GREEN MarkType = "green"
	GOLD  MarkType = "gold"
	N     MarkType = ""
)

Jump to

Keyboard shortcuts

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