handler

package
v0.0.0-...-cc025f6 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UUID string // not being used

)

global variables

Functions

func HandleConnections

func HandleConnections(w http.ResponseWriter, r *http.Request)

HandleConnections maintains the connection for each user in the chat

func HandleMessages

func HandleMessages()

HandleMessages sends and receives messages from users.

Types

type AllUsers

type AllUsers struct {
	Users []User `json:"users"`
}

AllUsers not being used AllUsers object, holds all the users in a string array

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"`
}

Message object, defines attributes that a message will have

type User

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

User not being used User object, holds information for a specific user

Jump to

Keyboard shortcuts

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