api

package
v0.0.0-...-ce806dc Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAPIRoutes

func BuildAPIRoutes(api_group *gin.RouterGroup, db *sql.DB, gameCache *background.GameCache, app *firebase.App)

Types

type Category

type Category struct {
	Name       string `json:"name"`
	Code       string `json:"code"`
	EventCount int    `json:"eventCount"`
	Year       int    `json:"year"`
}

type Event

type Event struct {
	EventId              string     `json:"eventId"`
	Year                 int        `json:"year"`
	Active               bool       `json:"active"`
	Title                string     `json:"title"`
	ShortDescription     string     `json:"shortDescription"`
	LongDescription      string     `json:"longDescription"`
	CategoryCode         string     `json:"categoryCode"`
	GameSystem           GameSystem `json:"gameSystem"`
	RulesEdition         string     `json:"rulesEdition"`
	MinPlayers           int        `json:"minPlayers"`
	MaxPlayers           int        `json:"maxPlayers"`
	AgeRequired          string     `json:"ageRequired"`
	ExperienceRequired   string     `json:"experienceRequired"`
	MaterialsProvided    bool       `json:"materialsProvided"`
	StartTime            time.Time  `json:"startTime"`
	Duration             int        `json:"duration"`
	EndTime              time.Time  `json:"endTime"`
	GMNames              string     `json:"gmNames"`
	Website              string     `json:"website"`
	Email                string     `json:"email"`
	IsTournament         bool       `json:"isTournament"`
	RoundNumber          int        `json:"roundNumber"`
	TotalRounds          int        `json:"totalRounds"`
	MinPlayTime          int        `json:"minPlayTime"`
	AttendeeRegistration string     `json:"attendeeRegistration"`
	Cost                 int        `json:"cost"`
	Location             string     `json:"location"`
	RoomName             string     `json:"roomName"`
	TableNumber          string     `json:"tableNumber"`
	TicketsAvailable     int        `json:"ticketsAvailable"`
	LastModified         time.Time  `json:"lastModified"`
	RelatedEvents        []EventRef `json:"relatedEvents"`
}

type EventRef

type EventRef struct {
	EventId          string    `json:"eventId"`
	TicketsAvailable int       `json:"ticketsAvailable"`
	StartTime        time.Time `json:"startTime"`
	EndTime          time.Time `json:"endTime"`
}

type EventSummary

type EventSummary struct {
	AnchorEventId    string     `json:"anchorEventId"`
	ShortDescription string     `json:"shortDescription"`
	NumEvents        int        `json:"numEvents"`
	WedTickets       int        `json:"wedTickets"`
	ThuTickets       int        `json:"thuTickets"`
	FriTickets       int        `json:"friTickets"`
	SatTickets       int        `json:"satTickets"`
	SunTickets       int        `json:"sunTickets"`
	GameSystem       GameSystem `json:"gameSystem"`
}

Used in search results

type EventsSearch

type EventsSearch struct {
	Category      string `form:"cat"`
	Year          int    `form:"year"`
	MinWedTickets int    `form:"minWedTickets"`
	MinThuTickets int    `form:"minThuTickets"`
	MinFriTickets int    `form:"minFriTickets"`
	MinSatTickets int    `form:"minSatTickets"`
	MinSunTickets int    `form:"minSunTickets"`

	// Not yet implemented
	TextQuery string `form:"search"`
}

Search param struct for looking up events

type GameSystem

type GameSystem struct {
	Name          string  `json:"name"`
	BggId         int64   `json:"bggId,omitempty"`
	BggRating     float64 `json:"bggRating,omitempty"`
	NumBggRatings int64   `json:"numBggRatings,omitempty"`
	YearPublished int64   `json:"yearPublished,omitempty"`
}

type User

type User struct {
	Email       string `json:"email"`
	DisplayName string `json:"displayName"`
}

type UserEvents

type UserEvents struct {
	Email           string   `json:"email"`
	Year            int      `json:"year"`
	StarredClusters []string `json:"starredClusters"`
	StarredEvents   []string `json:"starredEvents"`
	TicketedEvents  []string `json:"ticketedEvents"`
}

Jump to

Keyboard shortcuts

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