Documentation
¶
Index ¶
- Constants
- func GetEndpoint(room Room, path string) string
- func GetTypingParam(isTyping bool) string
- type Event
- type Room
- type Session
- func (s *Session) AddHandler(eventType string, h func(Event))
- func (s *Session) GetMessages() error
- func (s *Session) GetUserByName(name string) user
- func (s *Session) GetUsers() []user
- func (s *Session) IsJoined() bool
- func (s *Session) JoinRoom(room Room) error
- func (s *Session) Listen()
- func (s *Session) ParseSystemMessage(msg string)
- func (s *Session) RoomState() (roomState, error)
- func (s *Session) SendMessage(msg string) error
- func (s *Session) SetTyping(isTyping bool) error
- func (s *Session) UpdateIndex() error
- func (s *Session) UpdateName(name string) error
- func (s *Session) UpdateUsers(users []user, runHandlers bool) error
Constants ¶
View Source
const BaseURL = "http://www.disposablechat.com/chat"
Disposable Chat Endpoint
Variables ¶
This section is empty.
Functions ¶
func GetTypingParam ¶
Types ¶
type Session ¶
type Session struct { Name string Room Room Client http.Client // contains filtered or unexported fields }
func (*Session) AddHandler ¶
AddHandler adds a handler for the given event type
func (*Session) GetMessages ¶
GetMessages retrieves the current state of the chat room and runs any registered message handlers.
func (*Session) GetUserByName ¶
func (*Session) ParseSystemMessage ¶
func (*Session) SendMessage ¶
SendMessage sends a message to the current chat room.
func (*Session) UpdateIndex ¶
UpdateIndex updates the room index to the latest state.
func (*Session) UpdateName ¶
func (*Session) UpdateUsers ¶
Click to show internal directories.
Click to hide internal directories.