Files
go-socket/structs.go
T
2026-04-05 15:13:44 +02:00

43 lines
1.0 KiB
Go

package main
import (
"time"
"github.com/coder/websocket"
)
type User struct {
Name string
Pronouns string
PasswordHash string
CreatedAt time.Time
WsConn *websocket.Conn
Id uint32
Groups map[uint32]struct{}
Connections map[uint32]*Connection
Color [3]uint8
}
type Connection struct {
CreatedAt time.Time `json:"createdAt"`
With uint32 `json:"-"`
IsFromUser bool `json:"isFromUser"`
IsAccepted bool `json:"isAccepted"`
}
type Group struct {
Name string `json:"name"`
CreatedAt time.Time `json:"createdAt"`
Id uint32 `json:"-"`
CreatorId uint32 `json:"creatorId"`
OwnerId uint32 `json:"ownerId"`
Users map[uint32]struct{} `json:"-"`
Color [3]uint8 `json:"color"`
EnableUserColors bool `json:"enableUserColors"`
}
type LoginReturn struct {
Token string `json:"token"`
UserId uint32 `json:"userId"`
}