Documentation ¶
Index ¶
- Variables
- func GenBinaryImageByPath(path string, imageType protocol.ImageType) (*bytes.Buffer, string, error)
- func GenBinaryImageByUrl(url string, imageType protocol.ImageType) (*bytes.Buffer, string, error)
- func GetImageBinData(ctx context.Context, tenantKey, appID, imageKey string) ([]byte, error)
- func GetImageKey(ctx context.Context, tenantKey, appID, url, path string) (string, error)
- func NewATag(text string, unURLEncode bool, href string) *protocol.RichTextElementForm
- func NewActionButton(text *protocol.TextForm, params map[string]string, ...) *protocol.ButtonForm
- func NewAtTag(text, userID string) *protocol.RichTextElementForm
- func NewButton(text *protocol.TextForm, url *string, multiURL *protocol.URLForm, ...) *protocol.ButtonForm
- func NewField(short bool, text *protocol.TextForm) *protocol.FieldForm
- func NewImage(alt *protocol.TextForm, imageKey string) *protocol.ImageForm
- func NewImageTag(imageKey string, height int32, width int32) *protocol.RichTextElementForm
- func NewJumpButton(text *protocol.TextForm, url *string, multiURL *protocol.URLForm, ...) *protocol.ButtonForm
- func NewJumpOption(text protocol.TextForm, url *string, multiURL *protocol.URLForm) protocol.OptionForm
- func NewMDText(content string, lines *int, i18n *protocol.I18NForm, ...) *protocol.TextForm
- func NewMultiPlatformURL(Url *string, AndroidUrl *string, IOSUrl *string, PCUrl *string) *protocol.URLForm
- func NewOption(text protocol.TextForm, value string) protocol.OptionForm
- func NewOverflowMenu(params map[string]string, options []protocol.OptionForm, ...) *protocol.OverflowForm
- func NewPickerDate(placeHolder *protocol.TextForm, params map[string]string, ...) *protocol.PickerDateForm
- func NewPickerDatetime(placeHolder *protocol.TextForm, params map[string]string, ...) *protocol.PickerDatetimeForm
- func NewPickerTime(placeHolder *protocol.TextForm, params map[string]string, ...) *protocol.PickerTimeForm
- func NewPlainText(content *string, i18n *protocol.I18NForm, lines *int) *protocol.TextForm
- func NewRichTextContent() *protocol.RichTextContent
- func NewRichTextElementForm() *protocol.RichTextElementForm
- func NewRichTextForm(title *string, content *protocol.RichTextContent) *protocol.RichTextForm
- func NewSelectPersonMenu(placeHolder *protocol.TextForm, params map[string]string, ...) *protocol.SelectorForm
- func NewSelectStaticMenu(placeHolder *protocol.TextForm, params map[string]string, ...) *protocol.SelectorForm
- func NewTextTag(text string, unURLEncode bool, lines int32) *protocol.RichTextElementForm
- func SendCardMessage(ctx context.Context, tenantKey, appID string, user *protocol.UserInfo, ...) (*protocol.SendCardMsgResponse, error)
- func SendCardMessageBatch(ctx context.Context, tenantKey, appID string, info *protocol.BatchBaseInfo, ...) (*protocol.SendCardMsgBatchResponse, error)
- func SendImageMessage(ctx context.Context, tenantKey, appID string, user *protocol.UserInfo, ...) (*protocol.SendMsgResponse, error)
- func SendImageMessageBatch(ctx context.Context, tenantKey, appID string, info *protocol.BatchBaseInfo, ...) (*protocol.SendMsgBatchResponse, error)
- func SendRichTextMessage(ctx context.Context, tenantKey, appID string, user *protocol.UserInfo, ...) (*protocol.SendMsgResponse, error)
- func SendRichTextMessageBatch(ctx context.Context, tenantKey, appID string, info *protocol.BatchBaseInfo, ...) (*protocol.SendMsgBatchResponse, error)
- func SendShareChatMessage(ctx context.Context, tenantKey, appID string, user *protocol.UserInfo, ...) (*protocol.SendMsgResponse, error)
- func SendShareChatMessageBatch(ctx context.Context, tenantKey, appID string, info *protocol.BatchBaseInfo, ...) (*protocol.SendMsgBatchResponse, error)
- func SendTextMessage(ctx context.Context, tenantKey, appID string, user *protocol.UserInfo, ...) (*protocol.SendMsgResponse, error)
- func SendTextMessageBatch(ctx context.Context, tenantKey, appID string, info *protocol.BatchBaseInfo, ...) (*protocol.SendMsgBatchResponse, error)
- func UpdateCard(ctx context.Context, tenantKey, appID string, token string, ...) (*protocol.UpdateCardResponse, error)
- func UploadImage(ctx context.Context, tenantKey, appID string, body *bytes.Buffer, ...) (*protocol.UpLoadImageResponse, error)
- type CardBuilder
- func (builder *CardBuilder) AddActionBlock(actions []protocol.ActionElement) *CardBuilder
- func (builder *CardBuilder) AddDIVBlock(text *protocol.TextForm, field []protocol.FieldForm, extra interface{}) *CardBuilder
- func (builder *CardBuilder) AddHRBlock() *CardBuilder
- func (builder *CardBuilder) AddHeader(title protocol.TextForm, template string) *CardBuilder
- func (builder *CardBuilder) AddImageBlock(title *protocol.TextForm, alt protocol.TextForm, imageKey string) *CardBuilder
- func (builder *CardBuilder) AddNoteBlock(elements []protocol.BaseElement) *CardBuilder
- func (builder *CardBuilder) Build() (data []byte, err error)
- func (builder *CardBuilder) BuildForm() (card *protocol.CardForm, err error)
- func (builder *CardBuilder) SetConfig(config protocol.ConfigForm) *CardBuilder
- func (builder *CardBuilder) SetUpdatingUserGroup(users []string) *CardBuilder
- func (builder *CardBuilder) SwitchLocale(locale protocol.Language) *CardBuilder
Constants ¶
This section is empty.
Variables ¶
var (
LruCache *lru.Cache
)
Functions ¶
func GenBinaryImageByPath ¶
func GenBinaryImageByUrl ¶
func GetImageBinData ¶
func GetImageKey ¶
GetImageKey: get imagekey, image_type = message
func NewATag ¶
func NewATag(text string, unURLEncode bool, href string) *protocol.RichTextElementForm
func NewActionButton ¶
func NewActionButton(text *protocol.TextForm, params map[string]string, category protocol.ButtonStyle, confirm *protocol.ConfirmForm, method string) *protocol.ButtonForm
new element button
func NewAtTag ¶
func NewAtTag(text, userID string) *protocol.RichTextElementForm
func NewButton ¶
func NewButton(text *protocol.TextForm, url *string, multiURL *protocol.URLForm, params map[string]string, category protocol.ButtonStyle, confirm *protocol.ConfirmForm, method string) *protocol.ButtonForm
new element button
func NewImageTag ¶
func NewImageTag(imageKey string, height int32, width int32) *protocol.RichTextElementForm
go can get imageKey by call the function "GetImageKey"
func NewJumpButton ¶
func NewJumpButton(text *protocol.TextForm, url *string, multiURL *protocol.URLForm, category protocol.ButtonStyle) *protocol.ButtonForm
new element button
func NewJumpOption ¶
func NewJumpOption(text protocol.TextForm, url *string, multiURL *protocol.URLForm) protocol.OptionForm
only be used for overflow elements
func NewMDText ¶
func NewMDText(content string, lines *int, i18n *protocol.I18NForm, href map[string]protocol.URLForm) *protocol.TextForm
new element lark_md
func NewMultiPlatformURL ¶
func NewOverflowMenu ¶
func NewOverflowMenu(params map[string]string, options []protocol.OptionForm, confirm *protocol.ConfirmForm, method string) *protocol.OverflowForm
func NewPickerDate ¶
func NewPickerDate(placeHolder *protocol.TextForm, params map[string]string, confirm *protocol.ConfirmForm, initialDate *string, method string) *protocol.PickerDateForm
new element picker date
func NewPickerDatetime ¶
func NewPickerDatetime(placeHolder *protocol.TextForm, params map[string]string, confirm *protocol.ConfirmForm, initialDatetime *string, method string) *protocol.PickerDatetimeForm
new element picker datetime
func NewPickerTime ¶
func NewPickerTime(placeHolder *protocol.TextForm, params map[string]string, confirm *protocol.ConfirmForm, initialTime *string, method string) *protocol.PickerTimeForm
new element picker time
func NewPlainText ¶
new element plain_text
func NewRichTextContent ¶
func NewRichTextContent() *protocol.RichTextContent
func NewRichTextElementForm ¶
func NewRichTextElementForm() *protocol.RichTextElementForm
func NewRichTextForm ¶
func NewRichTextForm(title *string, content *protocol.RichTextContent) *protocol.RichTextForm
func NewSelectPersonMenu ¶
func NewSelectPersonMenu(placeHolder *protocol.TextForm, params map[string]string, options []protocol.OptionForm, initOption *string, confirm *protocol.ConfirmForm, method string) *protocol.SelectorForm
func NewSelectStaticMenu ¶
func NewSelectStaticMenu(placeHolder *protocol.TextForm, params map[string]string, options []protocol.OptionForm, initOption *string, confirm *protocol.ConfirmForm, method string) *protocol.SelectorForm
func NewTextTag ¶
func NewTextTag(text string, unURLEncode bool, lines int32) *protocol.RichTextElementForm
func SendCardMessage ¶
func SendCardMessage(ctx context.Context, tenantKey, appID string, user *protocol.UserInfo, rootID string, card protocol.CardForm, updateMulti bool) (*protocol.SendCardMsgResponse, error)
SendCardMessage: send card message @param ctx: context @param tenantKey: tenant key. If you don't know it, ask your tenant administrator @param appID: your app ID @param user: the user who you will send message to @param rootID: The open_message_id of the message that needs to be replied. If do not reply to the message, fill in empty string @param card: the cardForm that you will send. You can view the demo code in file card_builder_test.go @param updateMulti: Controls whether the card is a shared card (all users share the same message card), the default is false
func SendCardMessageBatch ¶
func SendCardMessageBatch(ctx context.Context, tenantKey, appID string, info *protocol.BatchBaseInfo, rootID string, card protocol.CardForm, updateMulti bool) (*protocol.SendCardMsgBatchResponse, error)
SendCardMessageBatch: batch send card message @param ctx: context @param tenantKey: tenant key. If you don't know it, ask your tenant administrator @param appID: your app ID @param info: Department id list / user id list, you will send message to @param rootID: The open_message_id of the message that needs to be replied. If do not reply to the message, fill in empty string @param card: the cardForm that you will send. You can view the demo code in file card_builder_test.go @param updateMulti: Controls whether the card is a shared card (all users share the same message card), the default is false
func SendImageMessage ¶
func SendImageMessage(ctx context.Context, tenantKey, appID string, user *protocol.UserInfo, rootID string, url, path, imageKey string) (*protocol.SendMsgResponse, error)
SendImageMessage: send image message @param ctx: context @param tenantKey: tenant key. If you don't know it, ask your tenant administrator @param appID: your app ID @param user: the user who you will send message to @param rootID: The open_message_id of the message that needs to be replied. If do not reply to the message, fill in empty string @param url, path, imageKey: the image that you will send. imageKey > path(The local path name of the image) > url(The URL of the image)
func SendImageMessageBatch ¶
func SendImageMessageBatch(ctx context.Context, tenantKey, appID string, info *protocol.BatchBaseInfo, rootID string, url, path, imageKey string) (*protocol.SendMsgBatchResponse, error)
SendImageMessageBatch: batch send image message @param ctx: context @param tenantKey: tenant key. If you don't know it, ask your tenant administrator @param appID: your app ID @param info: Department id list / user id list, you will send message to @param rootID: The open_message_id of the message that needs to be replied. If do not reply to the message, fill in empty string @param url, path, imageKey: the image that you will send. imageKey > path(The local path name of the image) > url(The URL of the image)
func SendRichTextMessage ¶
func SendRichTextMessage(ctx context.Context, tenantKey, appID string, user *protocol.UserInfo, rootID string, postForm map[protocol.Language]*protocol.RichTextForm) (*protocol.SendMsgResponse, error)
SendRichTextMessage: send richtext message @param ctx: context @param tenantKey: tenant key. If you don't know it, ask your tenant administrator @param appID: your app ID @param user: the user who you will send message to @param rootID: The open_message_id of the message that needs to be replied. If do not reply to the message, fill in empty string @param postForm: the postForm that you will send. You can view the demo code in file richtext_builder_test.go
func SendRichTextMessageBatch ¶
func SendRichTextMessageBatch(ctx context.Context, tenantKey, appID string, info *protocol.BatchBaseInfo, rootID string, postForm map[protocol.Language]*protocol.RichTextForm) (*protocol.SendMsgBatchResponse, error)
SendRichTextMessageBatch: batch send richtext message @param ctx: context @param tenantKey: tenant key. If you don't know it, ask your tenant administrator @param appID: your app ID @param info: Department id list / user id list, you will send message to @param rootID: The open_message_id of the message that needs to be replied. If do not reply to the message, fill in empty string @param postForm: the postForm that you will send. You can view the demo code in file richtext_builder_test.go
func SendShareChatMessage ¶
func SendShareChatMessage(ctx context.Context, tenantKey, appID string, user *protocol.UserInfo, rootID string, shareChatID string) (*protocol.SendMsgResponse, error)
SendShareChatMessage: send shared chat message @param ctx: context @param tenantKey: tenant key. If you don't know it, ask your tenant administrator @param appID: your app ID @param user: the user who you will send message to @param rootID: The open_message_id of the message that needs to be replied. If do not reply to the message, fill in empty string @param shareChatID: shared chat id
func SendShareChatMessageBatch ¶
func SendShareChatMessageBatch(ctx context.Context, tenantKey, appID string, info *protocol.BatchBaseInfo, rootID string, shareChatID string) (*protocol.SendMsgBatchResponse, error)
SendShareChatMessageBatch: batch send shared chat message @param ctx: context @param tenantKey: tenant key. If you don't know it, ask your tenant administrator @param appID: your app ID @param info: Department id list / user id list, you will send message to @param rootID: The open_message_id of the message that needs to be replied. If do not reply to the message, fill in empty string @param shareChatID: shared chat id
func SendTextMessage ¶
func SendTextMessage(ctx context.Context, tenantKey, appID string, user *protocol.UserInfo, rootID string, text string) (*protocol.SendMsgResponse, error)
SendTextMessage: send text message @param ctx: context @param tenantKey: tenant key. If you don't know it, ask your tenant administrator @param appID: your app ID @param user: the user who you will send message to @param rootID: The open_message_id of the message that needs to be replied. If do not reply to the message, fill in empty string @param text: the text that you will send
func SendTextMessageBatch ¶
func SendTextMessageBatch(ctx context.Context, tenantKey, appID string, info *protocol.BatchBaseInfo, rootID string, text string) (*protocol.SendMsgBatchResponse, error)
SendTextMessageBatch: batch send text message @param ctx: context @param tenantKey: tenant key. If you don't know it, ask your tenant administrator @param appID: your app ID @param info: Department id list / user id list, you will send message to @param rootID: The open_message_id of the message that needs to be replied. If do not reply to the message, fill in empty string @param text: the text that you will send
Types ¶
type CardBuilder ¶
type CardBuilder struct { Header *protocol.CardHeaderForm Conf *protocol.ConfigForm OpenIDs []string Session *string // contains filtered or unexported fields }
func (*CardBuilder) AddActionBlock ¶
func (builder *CardBuilder) AddActionBlock(actions []protocol.ActionElement) *CardBuilder
add action block
func (*CardBuilder) AddDIVBlock ¶
func (builder *CardBuilder) AddDIVBlock(text *protocol.TextForm, field []protocol.FieldForm, extra interface{}) *CardBuilder
add div block
func (*CardBuilder) AddHeader ¶
func (builder *CardBuilder) AddHeader(title protocol.TextForm, template string) *CardBuilder
add header @param title : TextForm, tag must be "plain_text". Can call the NewPlainText function to get it @param template : Reserved field. Fill in the empty string
func (*CardBuilder) AddImageBlock ¶
func (builder *CardBuilder) AddImageBlock(title *protocol.TextForm, alt protocol.TextForm, imageKey string) *CardBuilder
add image block
func (*CardBuilder) AddNoteBlock ¶
func (builder *CardBuilder) AddNoteBlock(elements []protocol.BaseElement) *CardBuilder
add note block
func (*CardBuilder) BuildForm ¶
func (builder *CardBuilder) BuildForm() (card *protocol.CardForm, err error)
build card
func (*CardBuilder) SetConfig ¶
func (builder *CardBuilder) SetConfig(config protocol.ConfigForm) *CardBuilder
set ConfigForm
func (*CardBuilder) SetUpdatingUserGroup ¶
func (builder *CardBuilder) SetUpdatingUserGroup(users []string) *CardBuilder
set updating user group
func (*CardBuilder) SwitchLocale ¶
func (builder *CardBuilder) SwitchLocale(locale protocol.Language) *CardBuilder
switch to the i18n locale