Documentation
¶
Index ¶
- Constants
- Variables
- type BotResponse
- type Card
- type CardConfig
- type CardElement
- type CardElementAction
- type CardElementText
- type CardHeader
- type CardMessage
- type Client
- func (c *Client) BotHook(ctx context.Context, hookId string, text *TextMessage, post *PostMessage, ...) (*BotResponse, error)
- func (c *Client) Get(ctx context.Context, url string, queryParams urllib.Values, ...) (*fasthttp.Response, error)
- func (c *Client) Post(ctx context.Context, url string, body []byte, timeout time.Duration) (*fasthttp.Response, error)
- type PostContent
- type PostContentData
- type PostContentItem
- type PostMessage
- type TextContent
- type TextMessage
- type ZhCnPostContentData
Constants ¶
View Source
const CustomBotHost = "https://open.feishu.cn/open-apis"
Variables ¶
View Source
var (
LarkClient = NewHttpClient(maxConnsPerhost, defaultTimeout)
)
Functions ¶
This section is empty.
Types ¶
type BotResponse ¶
type Card ¶
type Card struct { Config CardConfig `json:"config"` Elements []*CardElement `json:"elements"` Header CardHeader `json:"header"` }
type CardConfig ¶
type CardElement ¶
type CardElement struct { Tag string `json:"tag"` Text CardElementText `json:"text"` Action CardElementAction `json:"actions"` }
type CardElementAction ¶
type CardElementAction struct { Tag string `json:"tag"` Text CardElementText `json:"text"` Url string `json:"url"` Type string `json:"type"` }
type CardElementText ¶
type CardHeader ¶
type CardHeader struct {
Title CardElementText `json:"title"`
}
type CardMessage ¶
CardMessage 卡片消息
type Client ¶
func NewHttpClient ¶
func (*Client) BotHook ¶
func (c *Client) BotHook(ctx context.Context, hookId string, text *TextMessage, post *PostMessage, card *CardMessage) (*BotResponse, error)
type PostContent ¶
type PostContent struct {
Post *ZhCnPostContentData `json:"post"`
}
type PostContentData ¶
type PostContentData struct { Title string `json:"title"` Content [][]*PostContentItem `json:"content"` }
type PostContentItem ¶
type PostMessage ¶
type PostMessage struct { MessageType string `json:"msg_type"` Content *PostContent `json:"content"` }
PostMessage 富文本消息
type TextContent ¶
type TextContent struct {
Text string `json:"text"`
}
type TextMessage ¶
type TextMessage struct { MessageType string `json:"msg_type"` Content *TextContent `json:"content"` }
TextMessage 文本消息
type ZhCnPostContentData ¶
type ZhCnPostContentData struct {
ZhCn PostContentData `json:"zh_cn"`
}
Click to show internal directories.
Click to hide internal directories.