Created sessions life loop

This commit is contained in:
2025-11-16 09:08:43 +03:00
parent bf921ea8d4
commit 6417964385
3 changed files with 111 additions and 13 deletions

19
api/helper.go Normal file
View File

@@ -0,0 +1,19 @@
package api
import (
"sync"
"time"
"github.com/gorilla/websocket"
)
type Session struct {
id string
aConn *websocket.Conn
bConn *websocket.Conn
lastInteractionTime time.Time
lastInteractedPartyIsA bool
}
var openSessions = make(map[string]Session)
var sessionsMu sync.RWMutex