chat

package
v0.0.0-...-121c169 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Username  string          `json:"username"`
	Message   string          `json:"message"`
	Avatar    string          `json:"avatar"`
	Encrypted bool            `json:"encrypted"`
	Leaving   bool            `json:"leaving"`
	UUID      string          `json:"uuid"`
	WS        *websocket.Conn `json:"-"`
	Users     map[string]User `json:"users"`
}

Message object, defines attributes that a message will have

type Room

type Room struct {
	UUID    string
	Users   map[string]User
	Clients map[*websocket.Conn]bool
}

Room holds the information for an individual room

func NewRoom

func NewRoom(uuid string) Room

NewRoom instantiates a new room object

type User

type User struct {
	Username string `json:"user"`
	Avatar   string `json:"avatar"`
}

User object, holds information for a specific user

func NewUser

func NewUser(username, avatar string) User

NewUser instatnitates a new user object

Jump to

Keyboard shortcuts

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