40 lines
872 B
Go
40 lines
872 B
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{}
|
|
Color [3]uint8
|
|
}
|
|
|
|
type Group struct {
|
|
Name string
|
|
CreatedAt time.Time
|
|
Id uint32
|
|
CreatorId uint32
|
|
OwnerId uint32
|
|
Users map[uint32]struct{}
|
|
Color [3]uint8
|
|
EnableUserColors bool
|
|
}
|
|
|
|
type GroupNoMembers struct {
|
|
Name string `json:"name"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Id uint32 `json:"id"`
|
|
CreatorId uint32 `json:"creatorId"`
|
|
OwnerId uint32 `json:"ownerId"`
|
|
Color [3]uint8 `json:"color"`
|
|
EnableUsersColors bool `json:"enableUsersColors"`
|
|
}
|