Documentation ¶
Index ¶
- Variables
- type Message
- type TalkRoom
- func (t *TalkRoom) DeleteMessage(messageID int) (*ocs.TalkRoomMessageData, error)
- func (t *TalkRoom) ReceiveMessages(ctx context.Context) (chan ocs.TalkRoomMessageData, error)
- func (t *TalkRoom) SendComplexMessage(msg *Message) (*ocs.TalkRoomMessageData, error)
- func (t *TalkRoom) SendMessage(msg string) (*ocs.TalkRoomMessageData, error)
- func (t *TalkRoom) TestConnection() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyToken is returned when the room token is empty ErrEmptyToken = errors.New("given an empty token") // ErrRoomNotFound is returned when a room with the given token could not be found ErrRoomNotFound = errors.New("room could not be found") ErrUnauthorized = errors.New("unauthorized error when accessing room") // ErrNotModeratorInLobby is returned when the room is in lobby mode but the user is not a moderator ErrNotModeratorInLobby = errors.New("room is in lobby mode but user is not a moderator") // ErrUnexpectedReturnCode is returned when the server did not respond with an expected return code ErrUnexpectedReturnCode = errors.New("unexpected return code") // ErrTooManyRequests is returned if the server returns a 429 ErrTooManyRequests = errors.New("too many requests") // ErrLackingCapabilities is returned if the server lacks the required capability for the given function ErrLackingCapabilities = errors.New("lacking required capabilities") // ErrForbidden is returned if the user is forbidden from accessing the requested resource ErrForbidden = errors.New("request forbidden") // ErrUnexpectedResponse is returned if the response from the Nextcloud Talk server is not formatted as expected ErrUnexpectedResponse = errors.New("unexpected response") )
Functions ¶
This section is empty.
Types ¶
type TalkRoom ¶
TalkRoom represents a room in Nextcloud Talk
func NewTalkRoom ¶ added in v0.1.0
NewTalkRoom returns a new TalkRoom instance Token should be the Nextcloud Room Token (e.g. "d6zoa2zs" if the room URL is https://cloud.mydomain.me/call/d6zoa2zs)
func (*TalkRoom) DeleteMessage ¶ added in v0.2.0
func (t *TalkRoom) DeleteMessage(messageID int) (*ocs.TalkRoomMessageData, error)
DeleteMessage deletes the message with the given messageID on the server.
Requires "delete-messages" capability on the Nextcloud Talk server
func (*TalkRoom) ReceiveMessages ¶
ReceiveMessages starts watching for new messages
func (*TalkRoom) SendComplexMessage ¶ added in v0.3.0
func (t *TalkRoom) SendComplexMessage(msg *Message) (*ocs.TalkRoomMessageData, error)
SendComplexMessage sends a Message type message in the talk room
func (*TalkRoom) SendMessage ¶
func (t *TalkRoom) SendMessage(msg string) (*ocs.TalkRoomMessageData, error)
SendMessage sends a string message in the Talk room
func (*TalkRoom) TestConnection ¶
TestConnection tests the connection with the Nextcloud Talk instance and returns an error if it could not connect
Click to show internal directories.
Click to hide internal directories.