room

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Index

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")
	// 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")
)

Functions

This section is empty.

Types

type TalkRoom

type TalkRoom struct {
	User  *user.TalkUser
	Token string
}

TalkRoom represents a room in Nextcloud Talk

func NewTalkRoom added in v0.1.0

func NewTalkRoom(tuser *user.TalkUser, token string) (*TalkRoom, error)

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) ReceiveMessages

func (t *TalkRoom) ReceiveMessages(ctx context.Context) (chan ocs.TalkRoomMessageData, error)

ReceiveMessages starts watching for new messages

func (*TalkRoom) SendMessage

func (t *TalkRoom) SendMessage(msg string) (*ocs.TalkRoomMessageData, error)

SendMessage sends a message in the Talk room

func (*TalkRoom) TestConnection

func (t *TalkRoom) TestConnection() error

TestConnection tests the connection with the Nextcloud Talk instance and returns an error if it could not connect

Jump to

Keyboard shortcuts

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