Passport/pkg/services/connections.go

18 lines
315 B
Go
Raw Normal View History

package services
import (
"git.solsynth.dev/hydrogen/identity/pkg/models"
"github.com/gofiber/contrib/websocket"
)
2024-03-31 08:03:59 +00:00
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
}