Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPrivateMessage ¶
func NewPrivateMessage(recipients []string) *message
func NewStreamMessage ¶
func NewStreamMessage(stream, topic string) *message
func Reply ¶
func Reply(msg *MessageResponse) *message
Types ¶
type BaseResponse ¶
type EventListener ¶
type EventListener interface {
HandleEvent(*EventResponse) bool
}
type EventResponse ¶
type EventResponse struct { Flags []string `json:"flags"` Message *MessageResponse `json:"message"` Type string `json:"type"` ID int64 `json:"id"` }
func (*EventResponse) IsMentioned ¶
func (e *EventResponse) IsMentioned() bool
type EventsResponse ¶
type EventsResponse struct { BaseResponse QueueID string `json:"queue_id"` Events []*EventResponse `json:"events"` }
type MessageResponse ¶
type MessageResponse struct { Content string `json:"content"` Subject string `json:"subject"` ContentType string `json:"content_type"` Client string `json:"client"` GravatarHash string `json:"gravatar_hash"` AvatarUrl string `json:"avatar_url"` ID int64 `json:"id"` SenderID int `json:"sender_id"` RecipientID int `json:"recipient_id"` SenderEmail string `json:"sender_email"` SenderDomain string `json:"sender_domain"` SenderFullName string `json:"sender_full_name"` SenderShortName string `json:"sender_short_name"` DisplayRecipient interface{} `json:"display_recipient"` SubjectLinks []string `json:"subject_links"` Reactions []string `json:"reactions"` Mentioned bool `json:"is_mentioned"` Type string `json:"type"` Timestamp int64 `json:"timestamp"` }
func (*MessageResponse) GetRecipients ¶
func (m *MessageResponse) GetRecipients() []string
func (*MessageResponse) GetStreamName ¶
func (m *MessageResponse) GetStreamName() string
func (*MessageResponse) GetTime ¶
func (m *MessageResponse) GetTime() time.Time
func (*MessageResponse) GetTopicName ¶
func (m *MessageResponse) GetTopicName() string
func (*MessageResponse) IsPrivate ¶
func (m *MessageResponse) IsPrivate() bool
type RegisterResponse ¶
type RegisterResponse struct { BaseResponse QueueID string `json:"queue_id"` MaxMessageID int64 `json:"max_message_id"` LastEventID int64 `json:"last_event_id"` }
type Zulip ¶
type Zulip struct { Debug bool // contains filtered or unexported fields }
func NewZulipApi ¶
func (*Zulip) GetEvents ¶
func (z *Zulip) GetEvents(handler EventListener)
func (*Zulip) SendMessage ¶
func (z *Zulip) SendMessage(msg *message)
func (*Zulip) SetBasicAuth ¶
Click to show internal directories.
Click to hide internal directories.