Passport/pkg/services/connections.go
2024-03-31 16:03:59 +08:00

18 lines
315 B
Go

package services
import (
"git.solsynth.dev/hydrogen/identity/pkg/models"
"github.com/gofiber/contrib/websocket"
)
type WsPushRequest struct {
Payload []byte
RecipientID uint
}
var WsConn = make(map[uint][]*websocket.Conn)
func CheckOnline(user models.Account) bool {
return len(WsConn[user.ID]) > 0
}