refactor: rename HandleConnections to HandleConnection

- rename function to better reflect its purpose

🤖
This commit is contained in:
Sebastian Mark 2024-10-29 18:49:00 +01:00
parent b8823acc97
commit d83acc77b2
2 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ func Start() {
listen := fmt.Sprintf("%s:%d", serverConfig.ListenAddress, serverConfig.ListenPort)
http.HandleFunc("/ws", websocket.HandleConnections)
http.HandleFunc("/ws", websocket.HandleConnection)
go websocket.SendPermanentBroadCastMessage()
log.Info("GoTomato started", "version", metadata.GoTomatoVersion)

View file

@ -18,8 +18,8 @@ var upgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool { return true },
}
// HandleConnections upgrades HTTP requests to WebSocket connections and manages the client lifecycle.
func HandleConnections(w http.ResponseWriter, r *http.Request) {
// HandleConnection upgrades HTTP requests to WebSocket connections and manages the client lifecycle.
func HandleConnection(w http.ResponseWriter, r *http.Request) {
// Upgrade initial GET request to a WebSocket
ws, err := upgrader.Upgrade(w, r, nil)
if err != nil {