controllers

package
v0.0.0-...-8db6ce2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChatWSHandler = &ChatHandler{Rooms: make(map[string]*models.Room)}

ChatWSHandler is the database of chat including rooms, hanlde ws requests

Functions

func ChatPageHandler

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

ChatPageHandler handle render the Chat Page

func GenCodeGeneratorLink(roomID string) string

GenCodeGeneratorLink returns the api path of qrcode generator endpoint

func GenerateRoomLink(scheme string, hostname string, roomID string) string

GenerateRoomLink handle create a new or provided room's link

func GetRoomMessages

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

GetRoomMessages handles get and return message of the room

func HomeHandler

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

HomeHandler will create a new room, render a new qrcode to clients

func QRCodeGenerationHandler

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

QRCodeGenerationHandler handle request code generation

Types

type ChatHandler

type ChatHandler struct {
	Rooms map[string]*models.Room
}

ChatHandler stores list of created rooms, serves http

func (*ChatHandler) ServeHTTP

func (chat *ChatHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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