dingtalk

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MsgTypeText     = "text"
	MsgTypeMarkdown = "markdown"
)
View Source
const Addr = "https://oapi.dingtalk.com/robot/send"

Variables

This section is empty.

Functions

func SendMessage

func SendMessage(c *httpx.Client, token, secret, text string) error

func SendMessageWithMap

func SendMessageWithMap(c *httpx.Client, token, secret string, data map[string]interface{}) error

func SendMessageWithReq

func SendMessageWithReq(c *httpx.Client, token, secret string, req *MessageReq) error

Types

type MessageAt

type MessageAt struct {
	AtMobiles []string `json:"atMobiles,omitempty"`
	AtUserIds []string `json:"atUserIds,omitempty"`
	IsAtAll   bool     `json:"isAtAll,omitempty"`
}

type MessageMarkdown

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

type MessageReq

type MessageReq struct {
	MsgType string     `json:"msgtype"`
	At      *MessageAt `json:"at,omitempty"`

	Text     *MessageText     `json:"text,omitempty"`
	Markdown *MessageMarkdown `json:"markdown,omitempty"`
}

type MessageResp

type MessageResp struct {
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

type MessageText

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

Jump to

Keyboard shortcuts

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