model

package
v0.0.0-...-68650f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelRequest

type CancelRequest struct {
	Id string `json:"id"`
}

type CollabMessage

type CollabMessage struct {
	UserId1    string `json:"user_id1"`
	UserId2    string `json:"user_id2"`
	MatchId1   string `json:"match_id1"`
	MatchId2   string `json:"match_id2"`
	Category   string `json:"category"`
	Complexity string `json:"complexity"`
}

type GetMatchFilter

type GetMatchFilter struct {
	UserId     string `json:"user_id" bson:"user_id"`
	Category   string `json:"category"`
	Complexity string `json:"complexity"`
}

type InvalidInputError

type InvalidInputError struct {
	Message string
}

func (InvalidInputError) Error

func (e InvalidInputError) Error() string

type Match

type Match struct {
	Id            primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"` // mongo uses _id in bson for their object id, json id is for our requests
	UserId        string             `json:"user_id" bson:"user_id"`
	Category      string             `json:"category"`
	Complexity    string             `json:"complexity"`
	HasMatch      bool               `json:"has_match" bson:"has_match"`
	CreatedAt     primitive.DateTime `json:"created_at" bson:"created_at"`
	IsCancelled   bool               `json:"is_cancelled" bson:"is_cancelled"`
	IsRoomCreated bool               `json:"is_room_created" bson:"is_room_created"`
	RoomId        string             `json:"room_id" bson:"room_id"`
}

type MatchRequest

type MatchRequest struct {
	Category   string `json:"category"`
	Complexity string `json:"complexity"`
}

type MatchRequestMessage

type MatchRequestMessage struct {
	Id     primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"` // mongo uses _id in bson for their object id, json id is for our requests
	UserId string             `json:"user_id" bson:"user_id"`
}

func (*MatchRequestMessage) UnmarshalJSON

func (m *MatchRequestMessage) UnmarshalJSON(data []byte) error

manual unmarshal to handle primitive.ObjectID type

type RoomCreatedReq

type RoomCreatedReq struct {
	MatchId1 string `json:"match_id1"`
	MatchId2 string `json:"match_id2"`
	RoomId   string `json:"room_id"`
}

type UpdateMatchRequest

type UpdateMatchRequest struct {
	UserId     string `json:"user_id" bson:"user_id"`
	Category   string `json:"category"`
	Complexity string `json:"complexity"`
	HasMatch   bool   `json:"has_match" bson:"has_match"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL