Documentation ¶
Index ¶
- Variables
- func GetTenantAccessToken(ctx context.Context, conf *config.MRChLogConfig) (string, error)
- func SendAlertMessage(ctx context.Context, token, chatID string, title, text string) error
- type CardActionBlock
- type CardButton
- type CardConfig
- type CardConfirm
- type CardContent
- type CardElement
- type CardField
- type CardHeader
- type CardNote
- type CardOption
- type CardSelectMenu
- type CardSplitLine
- type CardText
- type CardURL
- type ChatMembersInviteRequest
- type ChatMembersInviteRespBody
- type ChatMembersInviteResponse
- type CreateChatRequest
- type CreateChatRespBody
- type CreateChatResponse
- type CreateMessageRequest
- type CreateMessageResponse
- type DecryptToken
- type Event
- type GetChatInfoResponse
- type GetChatInfoResponseBody
- type GetMessageHistoryBody
- type GetMessageHistoryMessageItem
- type GetMessageHistoryResponse
- type Header
- type I18nNames
- type Mention
- type MentionV1
- type Message
- type MessageBody
- type MessageEvent
- type MessageItem
- type MessageSender
- type PinMessageRequest
- type PinMessageResponse
- type ReceiveEventEncrypt
- type ReceiveMessageEvent
- type Response
- type Sender
- type TenantAccessTokenRequest
- type TenantAccessTokenResponse
- type UpdateChatRequest
- type UpdateChatResponse
- type UploadImageResponse
- type UploadImageResponseBody
- type UserID
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TenantAccessTokenURL = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
)
APIPath
Functions ¶
func GetTenantAccessToken ¶
GetTenantAccessToken get tenant access token for app Refer to: https://open.feishu.cn/document/ukTMukTMukTM/ukDNz4SO0MjL5QzM/auth-v3/auth/tenant_access_token_internal
Types ¶
type CardActionBlock ¶
type CardButton ¶
type CardConfig ¶
type CardConfirm ¶
type CardContent ¶
type CardContent struct { Config *CardConfig `json:"config,omitempty"` Header *CardHeader `json:"header,omitempty"` Elements []*CardElement `json:"elements,omitempty"` }
Message card
type CardElement ¶
type CardElement struct { Tag string `json:"tag"` Text *CardText `json:"text,omitempty"` Fields []*CardField `json:"fields,omitempty"` ImgKey string `json:"img_key,omitempty"` Mode string `json:"mode,omitempty"` Alt *CardText `json:"alt,omitempty"` CustomWidth int `json:"custom_width,omitempty"` CompactWidth int `json:"compact_width,omitempty"` Preview bool `json:"preview,omitempty"` Title *CardText `json:"title,omitempty"` }
type CardHeader ¶
type CardNote ¶
type CardNote struct { Tag string `json:"tag,omitempty"` Elements []interface{} `json:"elements,omitempty"` }
type CardOption ¶
type CardSelectMenu ¶
type CardSelectMenu struct { Tag string `json:"tag"` PlaceHolder *CardText `json:"placeholder,omitempty"` InitialOption string `json:"initial_option,omitempty"` Options []*CardOption `json:"options,omitempty"` Value map[string]string `json:"value,omitempty"` Confirm []*CardConfirm `json:"confirm,omitempty"` }
type CardSplitLine ¶
type CardSplitLine struct {
Tag string `json:"tag"`
}
type CardText ¶
type CardText struct { Tag string `json:"tag,omitempty"` // 文本类型 lark_md plain_text Content string `json:"content,omitempty"` // 具体参见文档: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-card/overview#39ee4e65 Lines int `json:"lines,omitempty"` // 行数 }
type ChatMembersInviteRequest ¶
type ChatMembersInviteRequest struct {
IdList []string `json:"id_list,omitempty"`
}
type ChatMembersInviteRespBody ¶
type ChatMembersInviteRespBody struct {
InvalidIDList []string `json:"invalid_id_list"`
}
type ChatMembersInviteResponse ¶
type ChatMembersInviteResponse struct { Code int `json:"code"` Message string `json:"message"` Data *ChatMembersInviteRespBody `json:"data"` }
type CreateChatRequest ¶
type CreateChatRequest struct { Avatar string `json:"avatar,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` I18nNames *I18nNames `json:"i18n_names,omitempty"` OwnerId string `json:"owner_id,omitempty"` ChatMode string `json:"chat_mode,omitempty"` ChatType string `json:"chat_type,omitempty"` External bool `json:"external,omitempty"` JoinMessageVisibility string `json:"join_message_visibility,omitempty"` LeaveMessageVisibility string `json:"leave_message_visibility,omitempty"` MembershipApproval string `json:"membership_approval,omitempty"` }
type CreateChatRespBody ¶
type CreateChatRespBody struct { ChatId string `json:"chat_id,omitempty"` Avatar string `json:"avatar,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` I18nNames *I18nNames `json:"i18n_names,omitempty"` OwnerId string `json:"owner_id,omitempty"` OwnerIdType string `json:"owner_id_type,omitempty"` AddMemberPermission string `json:"add_member_permission,omitempty"` AtAllPermission string `json:"at_all_permission,omitempty"` EditPermission string `json:"edit_permission,omitempty"` ChatMode string `json:"chat_mode,omitempty"` ChatType string `json:"chat_type,omitempty"` ChatTag string `json:"chat_tag,omitempty"` External bool `json:"external,omitempty"` TenantKey string `json:"tenant_key,omitempty"` JoinMessageVisibility string `json:"join_message_visibility,omitempty"` LeaveMessageVisibility string `json:"leave_message_visibility,omitempty"` MembershipApproval string `json:"membership_approval,omitempty"` ModerationPermission string `json:"moderation_permission,omitempty"` }
type CreateChatResponse ¶
type CreateChatResponse struct { Code int `json:"code"` Message string `json:"message"` Data *CreateChatRespBody `json:"data"` }
type CreateMessageRequest ¶
type CreateMessageResponse ¶
type CreateMessageResponse struct { Code int `json:"code"` Message string `json:"message"` Data *MessageItem `json:"data"` }
type DecryptToken ¶
type GetChatInfoResponse ¶
type GetChatInfoResponse struct { Code int `json:"code"` Message string `json:"message"` Data *GetChatInfoResponseBody `json:"data"` }
type GetChatInfoResponseBody ¶
type GetChatInfoResponseBody struct { Avatar string `json:"avatar,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` I18nNames *I18nNames `json:"i18n_names,omitempty"` OwnerId string `json:"owner_id,omitempty"` OwnerIdType string `json:"owner_id_type,omitempty"` AddMemberPermission string `json:"add_member_permission,omitempty"` AtAllPermission string `json:"at_all_permission,omitempty"` EditPermission string `json:"edit_permission,omitempty"` ChatMode string `json:"chat_mode,omitempty"` ChatType string `json:"chat_type,omitempty"` ChatTag string `json:"chat_tag,omitempty"` External bool `json:"external,omitempty"` TenantKey string `json:"tenant_key,omitempty"` JoinMessageVisibility string `json:"join_message_visibility,omitempty"` LeaveMessageVisibility string `json:"leave_message_visibility,omitempty"` MembershipApproval string `json:"membership_approval,omitempty"` ModerationPermission string `json:"moderation_permission,omitempty"` }
type GetMessageHistoryBody ¶
type GetMessageHistoryBody struct { HasMore bool `json:"has_more"` PageToken string `json:"page_token,omitempty"` Items []*GetMessageHistoryMessageItem `json:"items,omitempty"` }
type GetMessageHistoryMessageItem ¶
type GetMessageHistoryMessageItem struct { MessageID string `json:"message_id,omitempty"` RootID string `json:"root_id,omitempty"` ParentID string `json:"parent_id,omitempty"` MsgType string `json:"msg_type,omitempty"` CreateTime string `json:"create_time,omitempty"` UpdateTime string `json:"update_time,omitempty"` Deleted bool `json:"deleted,omitempty"` ChatID string `json:"chat_id,omitempty"` Sender *MessageSender `json:"sender,omitempty"` Body *MessageBody `json:"body,omitempty"` Mentions []*MentionV1 `json:"mentions,omitempty"` UpperMessageID string `json:"upper_message_id,omitempty"` }
type GetMessageHistoryResponse ¶
type GetMessageHistoryResponse struct { Code int `json:"code"` Message string `json:"message"` Data *GetMessageHistoryBody `json:"data"` }
type Header ¶
type Header struct { EventID string `json:"event_id"` EventType string `json:"event_type"` CreateTime string `json:"create_time"` Token string `json:"token"` AppID string `json:"app_id"` TenantKey string `json:"tenant_key"` }
General Model
type Message ¶
type Message struct { MessageID string `json:"message_id"` RootID string `json:"root_id"` ParentID string `json:"parent_id"` CreateTime string `json:"create_time"` ChatID string `json:"chat_id"` ChatType string `json:"chat_type"` MessageType string `json:"message_type"` Content string `json:"content"` Mentions []*Mention `json:"mentions,omitempty"` }
type MessageBody ¶
type MessageBody struct {
Content string `json:"content,omitempty"`
}
type MessageEvent ¶
type MessageItem ¶
type MessageItem struct { MessageID string `json:"message_id,omitempty"` RootID string `json:"root_id,omitempty"` ParentID string `json:"parent_id,omitempty"` MsgType string `json:"msg_type,omitempty"` CreateTime string `json:"create_time,omitempty"` UpdateTime string `json:"update_time,omitempty"` Deleted bool `json:"deleted,omitempty"` ChatID string `json:"chat_id,omitempty"` Sender *MessageSender `json:"sender,omitempty"` Body *MessageBody `json:"body,omitempty"` }
type MessageSender ¶
type PinMessageRequest ¶
type PinMessageRequest struct {
MessageID string `json:"message_id"`
}
type PinMessageResponse ¶
type PinMessageResponse struct { Code int `json:"code"` Message string `json:"message"` Data struct { Pin *MessageItem `json:"pin"` } `json:"data"` }
type ReceiveEventEncrypt ¶
type ReceiveEventEncrypt struct {
Encrypt string `json:"encrypt" form:"encrypt"`
}
type ReceiveMessageEvent ¶
type ReceiveMessageEvent struct { Schema string `json:"schema"` Header Header `json:"header"` Event MessageEvent `json:"event"` }
type UpdateChatRequest ¶
type UpdateChatRequest struct { Avatar string `json:"avatar,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` I18nNames *I18nNames `json:"i18n_names,omitempty"` AddMemberPermission string `json:"add_member_permission,omitempty"` AtAllPermission string `json:"at_all_permission,omitempty"` EditPermission string `json:"edit_permission,omitempty"` OwnerId string `json:"owner_id,omitempty"` JoinMessageVisibility string `json:"join_message_visibility,omitempty"` LeaveMessageVisibility string `json:"leave_message_visibility,omitempty"` MembershipApproval string `json:"membership_approval,omitempty"` }
type UpdateChatResponse ¶
type UploadImageResponse ¶
type UploadImageResponse struct { Code int `json:"code"` Message string `json:"message"` Data *UploadImageResponseBody `json:"data,omitempty"` }
type UploadImageResponseBody ¶
type UploadImageResponseBody struct {
ImageKey string `json:"image_key"`
}
Click to show internal directories.
Click to hide internal directories.