package
Version:
v0.0.0-...-a0c15bd
Opens a new window with list of versions in this module.
Published: Jun 14, 2022
License: GPL-3.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
- Basic HTML: we use jet a library
- We use 3 external tools:
- routing: bmizerany/pat
- template engine: CloudyKit
- websocket: gorilla websocket
- renderPage renders a jet template, creates pages.
- We use 3 arguments: w (http.ResponseWriter), tmpl (string), data (jet.VarMap) <- can be empty
- Somebody connects to the webpage: func Home <- display the webpage
- func WsEndpoint is called to connect the WS
- When we connect to WS:
- go ListenForWs(&conn) <- is called
- go ListenForWs(&conn) <- is a goroutine on a infite loop
- wsChan <- payload <- everything sent on the payload is pass to wsChan
- func ListenToWsChannel() <- everything on the the payload is store on the variable e
- Here is where we process the payload, the logic, where we stract the username or the message.
- func broadcastToAll <- send the payload to all the clients
Documentation
¶
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.