model

package
v0.0.0-...-6d87e05 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Channel string
	Socket  *websocket.Conn
	Send    chan *domain.Chat
	Room    Room
	User    domain.User
	Saved   *chan SavedChat
}

Client represents a user connect to a room, one user may have many devices to chat, so it should not be the same as user

func (*Client) Read

func (client *Client) Read()

func (*Client) Write

func (client *Client) Write()

type Message

type Message struct {
	Email    string `json:"email"`
	Username string `json:"username"`
	Text     string `json:"text"`
}

type Room

type Room struct {
	Forward chan *domain.Chat
	Join    chan *Client
	Leave   chan *Client
	Clients map[*Client]bool
}

Room represents a room to chat

type SavedChat

type SavedChat struct {
	Chat *domain.Chat
}

SavedChat uses to save Chat to db

Jump to

Keyboard shortcuts

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