Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chatroom ¶
type Chatroom struct { Clients map[string]*UserClient Client chan *UserClient Relay chan *UserMessage Remove chan *UserClient }
func CreateChatroom ¶
func CreateChatroom() *Chatroom
func (*Chatroom) ReceiveAndNotify ¶
func (cr *Chatroom) ReceiveAndNotify()
func (*Chatroom) RegisterClient ¶
func (cr *Chatroom) RegisterClient()
func (*Chatroom) RemoveClient ¶
func (cr *Chatroom) RemoveClient()
func (*Chatroom) SendUserList ¶
func (cr *Chatroom) SendUserList()
type ClientList ¶
type ClientList struct {
Clients []string `json:"user_list"`
}
type UserClient ¶
type UserClient struct { Username string Chatroom *Chatroom Connection *websocket.Conn Message chan *UserMessage ClientList chan *ClientList }
func CreateUserClient ¶
func CreateUserClient(username string, cr *Chatroom, conn *websocket.Conn) *UserClient
func (*UserClient) ReadMessage ¶
func (uc *UserClient) ReadMessage()
func (*UserClient) WriteMessage ¶
func (uc *UserClient) WriteMessage()
type UserMessage ¶
Click to show internal directories.
Click to hide internal directories.