20 lines
345 B
Go
20 lines
345 B
Go
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
|