feat: implement permanent broadcast message functionality
- add SendPermanentBroadCastMessage to continuously send updates
- refactor BroadcastMessage to use a shared Message struct
- update pomodoro logic to modify broadcast.Message directly
- adjust client command handling to use broadcast.Clients map
- enhance ServerMessage struct with "Ongoing" and "Paused" fields
🤖
This commit is contained in:
parent
eba4065c6f
commit
9615d4d449
8 changed files with 75 additions and 65 deletions
|
@ -3,6 +3,7 @@ package server
|
|||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"git.smsvc.net/pomodoro/GoTomato/internal/broadcast"
|
||||
"git.smsvc.net/pomodoro/GoTomato/internal/websocket"
|
||||
"git.smsvc.net/pomodoro/GoTomato/pkg/models"
|
||||
"log"
|
||||
|
@ -23,6 +24,7 @@ func Start() {
|
|||
listen := fmt.Sprintf("%s:%d", serverConfig.ListenAddress, serverConfig.ListenPort)
|
||||
|
||||
http.HandleFunc("/ws", websocket.HandleConnections)
|
||||
go broadcast.SendPermanentBroadCastMessage()
|
||||
|
||||
log.Printf("Pomodoro WebSocket server started on %s\n", listen)
|
||||
err := http.ListenAndServe(listen, nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue