Documentation ¶
Overview ¶
Provides access to Rocket.Chat's realtime API via ddp
Index ¶
- type Client
- func (c *Client) AddStatusListener(listener func(int))
- func (c *Client) ArchiveChannel(roomId string) error
- func (c *Client) Close()
- func (c *Client) ConnectionAway() error
- func (c *Client) ConnectionOnline() error
- func (c *Client) CreateChannel(name string, users []string) error
- func (c *Client) CreateDirectMessage(username string) (string, error)
- func (c *Client) CreateGroup(name string, users []string) error
- func (c *Client) DeleteChannel(roomId string) error
- func (c *Client) DeleteMessage(message *models.Message) error
- func (c *Client) EditMessage(message *models.Message) error
- func (c *Client) GetChannelId(name string) (string, error)
- func (c *Client) GetChannelRoles(roomId string) error
- func (c *Client) GetChannelSubscriptions() ([]models.ChannelSubscription, error)
- func (c *Client) GetChannelsIn() ([]models.Channel, error)
- func (c *Client) GetMessageStreamUpdateChannel() chan models.Message
- func (c *Client) GetPermissions() ([]models.Permission, error)
- func (c *Client) GetPublicSettings() ([]models.Setting, error)
- func (c *Client) GetUserRoles() error
- func (c *Client) JoinChannel(roomId string) error
- func (c *Client) LeaveChannel(roomId string) error
- func (c *Client) LoadHistory(roomID string) error
- func (c *Client) Login(credentials *models.UserCredentials) (*models.User, error)
- func (c *Client) NewMessage(channel *models.Channel, text string) *models.Message
- func (c *Client) PinMessage(message *models.Message) error
- func (c *Client) ReactToMessage(message *models.Message, reaction string) error
- func (c *Client) Reconnect()
- func (c *Client) RegisterUser(credentials *models.UserCredentials) (*models.User, error)
- func (c *Client) SendMessage(message *models.Message) (*models.Message, error)
- func (c *Client) SetChannelDescription(roomId string, description string) error
- func (c *Client) SetChannelJoinCode(roomId string, joinCode string) error
- func (c *Client) SetChannelReadOnly(roomId string, readOnly bool) error
- func (c *Client) SetChannelTopic(roomId string, topic string) error
- func (c *Client) SetChannelType(roomId string, roomType string) error
- func (c *Client) SetPresence(status string) error
- func (c *Client) StarMessage(message *models.Message) error
- func (c *Client) StartTyping(roomId string, username string) error
- func (c *Client) StopTyping(roomId string, username string) error
- func (c *Client) Sub(name string, args ...interface{}) (chan string, error)
- func (c *Client) SubscribeRoomUpdates(rid string) error
- func (c *Client) SubscribeToMessageStream(channel *models.Channel, msgChannel chan models.Message) error
- func (c *Client) UnArchiveChannel(roomId string) error
- func (c *Client) UnPinMessage(message *models.Message) error
- func (c *Client) UnStarMessage(message *models.Message) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddStatusListener ¶
func (*Client) ArchiveChannel ¶
ArchiveChannel archives the channel Takes roomId
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/archive-rooms
func (*Client) ConnectionAway ¶
ConnectionAway sets connection status to away
func (*Client) ConnectionOnline ¶
ConnectionOnline sets connection status to online
func (*Client) CreateChannel ¶
CreateChannel creates a channel Takes name and users array
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/create-channels
func (*Client) CreateDirectMessage ¶
CreateDirectMessage gets the room ID for a direct message to a given UserName
func (*Client) CreateGroup ¶
CreateGroup creates a private group Takes group name and array of users
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/create-private-groups
func (*Client) DeleteChannel ¶
DeleteChannel deletes the channel Takes roomId
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/delete-rooms
func (*Client) DeleteMessage ¶
DeleteMessage deletes a message takes a message object
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/delete-message
func (*Client) EditMessage ¶
EditMessage edits a message takes message object
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/update-message
func (*Client) GetChannelRoles ¶
GetChannelRoles returns room roles
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/get-room-roles
func (*Client) GetChannelSubscriptions ¶
func (c *Client) GetChannelSubscriptions() ([]models.ChannelSubscription, error)
GetChannelSubscriptions gets users channel subscriptions Optionally includes date to get all since last check or 0 to get all
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/get-subscriptions
func (*Client) GetChannelsIn ¶
GetChannelsIn returns list of channels Optionally includes date to get all since last check or 0 to get all
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/get-rooms/
func (*Client) GetMessageStreamUpdateChannel ¶
GetMessageStreamUpdateChannel returns a channel over which messages from subscribed channels are delivered. Add channels with SubscribeRoomUpdates.
https://rocket.chat/docs/developer-guides/realtime-api/subscriptions/stream-room-messages/
func (*Client) GetPermissions ¶
func (c *Client) GetPermissions() ([]models.Permission, error)
GetPermissions gets permissions
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/get-permissions
func (*Client) GetPublicSettings ¶
GetPublicSettings gets public settings
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/get-public-settings
func (*Client) GetUserRoles ¶
GetUserRoles gets current users roles
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/get-user-roles
func (*Client) JoinChannel ¶
JoinChannel joins a channel Takes roomId
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/joining-channels
func (*Client) LeaveChannel ¶
LeaveChannel leaves a channel Takes roomId
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/leaving-rooms
func (*Client) LoadHistory ¶
LoadHistory loads history Takes roomID
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/load-history
func (*Client) Login ¶
Login a user. token shouldn't be nil, otherwise the password and the email are not allowed to be nil.
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/login/
func (*Client) NewMessage ¶
NewMessage creates basic message with an ID, a RoomID, and a Msg Takes channel and text
func (*Client) PinMessage ¶
PinMessage pins a message takes a message object
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/pin-message
func (*Client) ReactToMessage ¶
ReactToMessage adds a reaction to a message takes a message and emoji
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/set-reaction
func (*Client) RegisterUser ¶
RegisterUser a new user on the server. This function does not need a logged in user. The registered user gets logged in to set its username.
func (*Client) SendMessage ¶
SendMessage sends message to channel takes message
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/send-message
func (*Client) SetChannelDescription ¶
SetChannelDescription sets channels description takes roomId and description
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/save-room-settings
func (*Client) SetChannelJoinCode ¶
SetChannelJoinCode sets channel join code takes roomId and joinCode
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/save-room-settings
func (*Client) SetChannelReadOnly ¶
SetChannelReadOnly sets channel as read only takes roomId and boolean
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/save-room-settings
func (*Client) SetChannelTopic ¶
SetChannelTopic sets channel topic takes roomId and topic
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/save-room-settings
func (*Client) SetChannelType ¶
SetChannelType sets the channel type takes roomId and roomType
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/save-room-settings
func (*Client) SetPresence ¶
SetPresence set user presence
func (*Client) StarMessage ¶
StarMessage stars message takes a message object
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/star-message
func (*Client) Sub ¶
Subscribes to stream-notify-logged Returns a buffered channel
https://rocket.chat/docs/developer-guides/realtime-api/subscriptions/stream-room-messages/
func (*Client) SubscribeRoomUpdates ¶
SubscribeRoomUpdates subscribes to the message updates for a given room ID. Messages are delivered to the channel returned by GetMessageStreamUpdateChannel.
https://rocket.chat/docs/developer-guides/realtime-api/subscriptions/stream-room-messages/
func (*Client) SubscribeToMessageStream ¶
func (c *Client) SubscribeToMessageStream(channel *models.Channel, msgChannel chan models.Message) error
SubscribeToMessageStream Subscribes to the message updates of a channel Returns a buffered channel
https://rocket.chat/docs/developer-guides/realtime-api/subscriptions/stream-room-messages/
func (*Client) UnArchiveChannel ¶
UnArchiveChannel unarchives the channel Takes roomId
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/unarchive-rooms
func (*Client) UnPinMessage ¶
UnPinMessage unpins message takes a message object
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/unpin-messages
func (*Client) UnStarMessage ¶
UnStarMessage unstars message takes message object
https://rocket.chat/docs/developer-guides/realtime-api/method-calls/star-message