Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
CheckPasswordHash verifies if the given password matches the hash.
func HashPassword ¶
HashPassword hashes the given password using bcrypt.
Types ¶
type Group ¶
type Group struct { Name string `bson:"name" json:"name"` PasswordHash string `bson:"password_hash" json:"-"` CreatedAt time.Time `bson:"created_at" json:"created_at"` }
Group represents a padel group context.
type Match ¶
type Match struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id"` GroupName string `bson:"group_name" json:"group_name"` Timestamp time.Time `bson:"timestamp" json:"timestamp"` Status string `bson:"status" json:"status"` // "pending", "completed", "cancelled" }
Match represents a single match played in a group.
type MatchDetail ¶
type MatchDetail struct { MatchID primitive.ObjectID `bson:"match_id" json:"match_id"` Team1 []primitive.ObjectID `bson:"team1" json:"team1"` Team2 []primitive.ObjectID `bson:"team2" json:"team2"` ScoreTeam1 int `bson:"score_team1" json:"score_team1"` ScoreTeam2 int `bson:"score_team2" json:"score_team2"` }
MatchDetail stores the details of a match (teams, scores).
type MatchResponse ¶
type MatchResponse struct { ID primitive.ObjectID `json:"id"` GroupName string `json:"group_name"` Timestamp time.Time `json:"timestamp"` Team1 []PlayerInfo `json:"team1"` Team2 []PlayerInfo `json:"team2"` ScoreTeam1 int `json:"score_team1"` ScoreTeam2 int `json:"score_team2"` Status string `json:"status"` }
MatchResponse combines Match and MatchDetail with player names for API responses
type Player ¶
type Player struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id"` GroupName string `bson:"group_name" json:"group_name"` Name string `bson:"name" json:"name"` }
Player represents a player within a group.
type PlayerInfo ¶
PlayerInfo contains the essential player information for responses
Click to show internal directories.
Click to hide internal directories.