Documentation
¶
Index ¶
- type AddEmojiReactionOption
- type AddEmojiReactionResponse
- type DeleteMessageResponse
- type DisplayRecipient
- type DisplayRecipientObject
- type EditMessageOption
- func MoveToTopic(name string) EditMessageOption
- func NewContent(content string) EditMessageOption
- func SendNotificationToNewThread(yes bool) EditMessageOption
- func SendNotificationToOldThread(yes bool) EditMessageOption
- func SetPropagateMode(change PropagateMode) EditMessageOption
- func SetStreamID(id int) EditMessageOption
- type EditMessageResponse
- type FetchSingleMessageOption
- type FetchSingleMessageResponse
- type Flag
- type GetMessageOption
- func Anchor(anchor string) GetMessageOption
- func ApplyMarkdownMessage(applyMarkdown bool) GetMessageOption
- func ClientGravatarMessage(clientGravatar bool) GetMessageOption
- func IncludeAnchor(includeAnchor bool) GetMessageOption
- func MessageIDs(messageIDs []int) GetMessageOption
- func NarrowMessage(narrow narrow.Filter) GetMessageOption
- func NumAfter(numAfter int) GetMessageOption
- func NumBefore(numBefore int) GetMessageOption
- type GetMessagesReadReceipts
- type GetMessagesResponse
- type Message
- type Operation
- type PropagateMode
- type RemoveEmojiReactionOption
- type RemoveEmojiReactionResponse
- type RenderAMessageResponse
- type SendMessageOption
- type SendMessageResponse
- type Service
- func (svc *Service) AddEmojiReaction(ctx context.Context, messageID int, emojiName string, ...) (*AddEmojiReactionResponse, error)
- func (svc *Service) DeleteMessage(ctx context.Context, id int) (*DeleteMessageResponse, error)
- func (svc *Service) EditMessage(ctx context.Context, id int, options ...EditMessageOption) (*EditMessageResponse, error)
- func (svc *Service) FetchSingleMessage(ctx context.Context, messageID int, options ...FetchSingleMessageOption) (*FetchSingleMessageResponse, error)
- func (svc *Service) GetMessages(ctx context.Context, options ...GetMessageOption) (*GetMessagesResponse, error)
- func (svc *Service) GetMessagesReadReceipts(ctx context.Context, messageID int) (*GetMessagesReadReceipts, error)
- func (svc *Service) RemoveEmojiReaction(ctx context.Context, messageID int, options ...RemoveEmojiReactionOption) (*RemoveEmojiReactionResponse, error)
- func (svc *Service) RenderAMessage(ctx context.Context, content string) (*RenderAMessageResponse, error)
- func (svc *Service) SendMessage(ctx context.Context, to recipient.Recipient, content string, ...) (*SendMessageResponse, error)
- func (svc *Service) SendMessageToChannelTopic(ctx context.Context, channel recipient.Channel, topic string, content string, ...) (*SendMessageResponse, error)
- func (svc *Service) SendMessageToUsers(ctx context.Context, users recipient.Direct, content string, ...) (*SendMessageResponse, error)
- func (svc *Service) UpdatePersonalMessageFlags(ctx context.Context, messageIDs []int, op Operation, flag Flag) (*UpdatePersonalMessageFlags, error)
- func (svc *Service) UpdatePersonalMessageFlagsNarrow(ctx context.Context, anchor string, numBefore int, numAfter int, ...) (*UpdatePersonalMessageFlagsNarrow, error)
- func (svc *Service) UploadFile(ctx context.Context, filePath string) (*UploadFileResponse, error)
- func (svc *Service) UploadFileFromBytes(ctx context.Context, fileName string, fileBytes []byte) (*UploadFileResponse, error)
- func (svc *Service) UploadFileFromReader(ctx context.Context, fileName string, fileReader io.Reader) (*UploadFileResponse, error)
- type UpdatePersonalMessageFlags
- type UpdatePersonalMessageFlagsNarrow
- type UpdatePersonalMessageFlagsNarrowOption
- type UploadFileResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddEmojiReactionOption ¶
type AddEmojiReactionOption func(*addEmojiReactionOptions) error
func AddEmojiReactionEmojiCode ¶
func AddEmojiReactionEmojiCode(emojiCode string) AddEmojiReactionOption
func AddEmojiReactionReactionType ¶
func AddEmojiReactionReactionType(reactionType zulip.ReactionType) AddEmojiReactionOption
type AddEmojiReactionResponse ¶
type AddEmojiReactionResponse struct {
zulip.APIResponseBase
}
type DeleteMessageResponse ¶
type DeleteMessageResponse struct {
zulip.APIResponseBase
}
type DisplayRecipient ¶
type DisplayRecipient struct { IsChannel bool Channel string Users []DisplayRecipientObject }
func (*DisplayRecipient) UnmarshalJSON ¶
func (d *DisplayRecipient) UnmarshalJSON(b []byte) error
type DisplayRecipientObject ¶
type EditMessageOption ¶
type EditMessageOption func(*editMessageOptions) error
func MoveToTopic ¶
func MoveToTopic(name string) EditMessageOption
MoveToTopic The topic to move the message(s) to, to request changing the topic.
func NewContent ¶
func NewContent(content string) EditMessageOption
NewContent The updated content of the target message.
func SendNotificationToNewThread ¶
func SendNotificationToNewThread(yes bool) EditMessageOption
SendNotificationToNewThread Whether to send an automated message to the new topic to notify users where the messages came from.
func SendNotificationToOldThread ¶
func SendNotificationToOldThread(yes bool) EditMessageOption
SendNotificationToOldThread Whether to send an automated message to the old topic to notify users where the messages were moved to.
func SetPropagateMode ¶
func SetPropagateMode(change PropagateMode) EditMessageOption
SetPropagateMode Which message(s) should be edited
func SetStreamID ¶
func SetStreamID(id int) EditMessageOption
SetStreamID The channel ID to move the message(s) to, to request moving messages to another channel.
type EditMessageResponse ¶
type EditMessageResponse struct { zulip.APIResponseBase // contains filtered or unexported fields }
func (*EditMessageResponse) UnmarshalJSON ¶
func (e *EditMessageResponse) UnmarshalJSON(b []byte) error
type FetchSingleMessageOption ¶
type FetchSingleMessageOption func(*fetchSingleMessageOptions)
func ApplyMarkdownSingleMessage ¶
func ApplyMarkdownSingleMessage(applyMarkdown bool) FetchSingleMessageOption
type FetchSingleMessageResponse ¶
type FetchSingleMessageResponse struct { zulip.APIResponseBase // contains filtered or unexported fields }
func (*FetchSingleMessageResponse) UnmarshalJSON ¶
func (f *FetchSingleMessageResponse) UnmarshalJSON(b []byte) error
type Flag ¶
type Flag string
const ( FlagRead Flag = "read" FlagStarred Flag = "starred" FlagCollapsed Flag = "collapsed" FlagMentioned Flag = "mentioned" FlagStreamWildcardMentioned Flag = "stream_wildcard_mentioned" FlagTopicWildcardMentioned Flag = "topic_wildcard_mentioned" FlagHasAlertWord Flag = "has_alert_word" FlagHistorical Flag = "historical" )
type GetMessageOption ¶
type GetMessageOption func(*getMessageOptions)
func Anchor ¶
func Anchor(anchor string) GetMessageOption
func ApplyMarkdownMessage ¶
func ApplyMarkdownMessage(applyMarkdown bool) GetMessageOption
func ClientGravatarMessage ¶
func ClientGravatarMessage(clientGravatar bool) GetMessageOption
func IncludeAnchor ¶
func IncludeAnchor(includeAnchor bool) GetMessageOption
func MessageIDs ¶
func MessageIDs(messageIDs []int) GetMessageOption
func NarrowMessage ¶
func NarrowMessage(narrow narrow.Filter) GetMessageOption
func NumAfter ¶
func NumAfter(numAfter int) GetMessageOption
func NumBefore ¶
func NumBefore(numBefore int) GetMessageOption
type GetMessagesReadReceipts ¶
type GetMessagesReadReceipts struct { zulip.APIResponseBase // contains filtered or unexported fields }
func (*GetMessagesReadReceipts) UnmarshalJSON ¶
func (g *GetMessagesReadReceipts) UnmarshalJSON(b []byte) error
type GetMessagesResponse ¶
type GetMessagesResponse struct { zulip.APIResponseBase // contains filtered or unexported fields }
func (*GetMessagesResponse) UnmarshalJSON ¶
func (g *GetMessagesResponse) UnmarshalJSON(b []byte) error
type Message ¶
type Message struct { AvatarURL string `json:"avatar_url"` Client string `json:"client"` Content string `json:"content"` ContentType string `json:"content_type"` DisplayRecipient DisplayRecipient `json:"display_recipient"` EditHistory []struct{} `json:"edit_history"` ID int `json:"id"` IsMeMessage bool `json:"is_me_message"` LastEditTimestamp int `json:"last_edit_timestamp"` Reactions []struct { EmojiName string `json:"emoji_name"` EmojiCode string `json:"emoji_code"` ReactionType string `json:"reaction_type"` UserID int `json:"user_id"` User DisplayRecipient `json:"user"` } `json:"reactions"` RecipientID int `json:"recipient_id"` SenderEmail string `json:"sender_email"` SenderFullName string `json:"sender_full_name"` SenderID int `json:"sender_id"` SenderRealmStr string `json:"sender_realm_str"` StreamID int `json:"stream_id"` Subject string `json:"subject"` Submessages []struct { MsgType string `json:"msg_type"` Content string `json:"content"` MessageID int `json:"message_id"` SenderID int `json:"sender_id"` ID int `json:"id"` } `json:"submessages"` Timestamp int `json:"timestamp"` TopicLinks []struct { Text string `json:"text"` URL string `json:"url"` } `json:"topic_links"` Type string `json:"type"` Flags []string `json:"flags"` MatchContent string `json:"match_content"` MathSubject string `json:"match_subject"` }
type PropagateMode ¶
type PropagateMode string
const ( // PropagateModeLater The target message and all following messages. PropagateModeLater PropagateMode = "change_later" // PropagateModeOne Only the target message. PropagateModeOne PropagateMode = "change_one" // PropagateModeAll All messages in this topic. PropagateModeAll PropagateMode = "change_all" )
type RemoveEmojiReactionOption ¶
type RemoveEmojiReactionOption func(*removeEmojiReactionOptions) error
func RemoveEmojiReactionEmojiCode ¶
func RemoveEmojiReactionEmojiCode(emojiCode string) RemoveEmojiReactionOption
func RemoveEmojiReactionEmojiName ¶
func RemoveEmojiReactionEmojiName(emojiName string) RemoveEmojiReactionOption
func RemoveEmojiReactionReactionType ¶
func RemoveEmojiReactionReactionType(reactionType zulip.ReactionType) RemoveEmojiReactionOption
type RemoveEmojiReactionResponse ¶
type RemoveEmojiReactionResponse struct {
zulip.APIResponseBase
}
type RenderAMessageResponse ¶
type RenderAMessageResponse struct { zulip.APIResponseBase // contains filtered or unexported fields }
func (*RenderAMessageResponse) UnmarshalJSON ¶
func (r *RenderAMessageResponse) UnmarshalJSON(b []byte) error
type SendMessageOption ¶
type SendMessageOption func(*sendMessageOptions) error
func ReadBySender ¶
func ReadBySender(asRead bool) SendMessageOption
ReadBySender Whether the message should be initially marked read by its sender. If unspecified, the server uses a heuristic based on the client name.
func ToTopic ¶
func ToTopic(name string) SendMessageOption
ToTopic The topic of the message. Only required for channel messages ("type": "stream" or "type": "channel"), ignored otherwise.
type SendMessageResponse ¶
type SendMessageResponse struct { zulip.APIResponseBase // contains filtered or unexported fields }
func (*SendMessageResponse) UnmarshalJSON ¶
func (s *SendMessageResponse) UnmarshalJSON(b []byte) error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(c zulip.RESTClient) *Service
func (*Service) AddEmojiReaction ¶
func (svc *Service) AddEmojiReaction(ctx context.Context, messageID int, emojiName string, options ...AddEmojiReactionOption) (*AddEmojiReactionResponse, error)
func (*Service) DeleteMessage ¶
func (*Service) EditMessage ¶
func (svc *Service) EditMessage(ctx context.Context, id int, options ...EditMessageOption) (*EditMessageResponse, error)
func (*Service) FetchSingleMessage ¶
func (svc *Service) FetchSingleMessage(ctx context.Context, messageID int, options ...FetchSingleMessageOption) (*FetchSingleMessageResponse, error)
func (*Service) GetMessages ¶
func (svc *Service) GetMessages(ctx context.Context, options ...GetMessageOption) (*GetMessagesResponse, error)
func (*Service) GetMessagesReadReceipts ¶
func (*Service) RemoveEmojiReaction ¶
func (svc *Service) RemoveEmojiReaction(ctx context.Context, messageID int, options ...RemoveEmojiReactionOption) (*RemoveEmojiReactionResponse, error)
func (*Service) RenderAMessage ¶
func (*Service) SendMessage ¶
func (svc *Service) SendMessage(ctx context.Context, to recipient.Recipient, content string, options ...SendMessageOption) (*SendMessageResponse, error)
func (*Service) SendMessageToChannelTopic ¶
func (svc *Service) SendMessageToChannelTopic(ctx context.Context, channel recipient.Channel, topic string, content string, options ...SendMessageOption) (*SendMessageResponse, error)
func (*Service) SendMessageToUsers ¶
func (svc *Service) SendMessageToUsers(ctx context.Context, users recipient.Direct, content string, options ...SendMessageOption) (*SendMessageResponse, error)
func (*Service) UpdatePersonalMessageFlags ¶
func (*Service) UpdatePersonalMessageFlagsNarrow ¶
func (*Service) UploadFile ¶
func (*Service) UploadFileFromBytes ¶
func (*Service) UploadFileFromReader ¶
type UpdatePersonalMessageFlags ¶
type UpdatePersonalMessageFlags struct { zulip.APIResponseBase // contains filtered or unexported fields }
func (*UpdatePersonalMessageFlags) UnmarshalJSON ¶
func (g *UpdatePersonalMessageFlags) UnmarshalJSON(b []byte) error
type UpdatePersonalMessageFlagsNarrow ¶
type UpdatePersonalMessageFlagsNarrow struct { zulip.APIResponseBase // contains filtered or unexported fields }
func (*UpdatePersonalMessageFlagsNarrow) UnmarshalJSON ¶
func (g *UpdatePersonalMessageFlagsNarrow) UnmarshalJSON(b []byte) error
type UpdatePersonalMessageFlagsNarrowOption ¶
type UpdatePersonalMessageFlagsNarrowOption func(*updatePersonalMessageFlagsNarrowOptions)
func UpdatePersonalMessageFlagsNarrowIncludeAnchor ¶
func UpdatePersonalMessageFlagsNarrowIncludeAnchor() UpdatePersonalMessageFlagsNarrowOption
type UploadFileResponse ¶
type UploadFileResponse struct { zulip.APIResponseBase // contains filtered or unexported fields }
func (*UploadFileResponse) UnmarshalJSON ¶
func (u *UploadFileResponse) UnmarshalJSON(b []byte) error