zulip

package module
v0.0.0-...-a2328c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

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 BaseResponse struct {
	Result string `json:"result"`
	Msg    string `json:"msg"`
}

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 NewZulipApi(baseUrl string) *Zulip

func (*Zulip) GetEvents

func (z *Zulip) GetEvents(handler EventListener)

func (*Zulip) Register

func (z *Zulip) Register(event_types []string) string

func (*Zulip) SendMessage

func (z *Zulip) SendMessage(msg *message)

func (*Zulip) SetBasicAuth

func (z *Zulip) SetBasicAuth(login, pass string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL