controllers

package
v0.0.0-...-78ea3c1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BookTicket

func BookTicket(c *gin.Context)

BookTicket handles the booking of a ticket for a game

func ClearGamesTable

func ClearGamesTable() error

func CurrentFixtures

func CurrentFixtures(c *gin.Context)

func Fixture

func Fixture(c *gin.Context)

func Home

func Home(c *gin.Context)

func Login

func Login(c *gin.Context)

Need to create handlers now

func Logout

func Logout(c *gin.Context)

func NextFixtures

func NextFixtures(c *gin.Context)

func Premium

func Premium(c *gin.Context)

func SaveGameToDatabase

func SaveGameToDatabase(fixtures []gin.H) error

func Signup

func Signup(c *gin.Context)

func Standings

func Standings(c *gin.Context)

Types

type CurrentGameweekResponse

type CurrentGameweekResponse struct {
	Fixture     Fixture1    `json:"fixture"`
	League      League      `json:"league"`
	GoalsScored GoalsScored `json:"goals"`
	Teams       Teams       `json:"teams"`
}

type Fixture1

type Fixture1 struct {
	Id        int    `json:"id"`
	Date      string `json:"date"`
	Timestamp int    `json:"timestamp"`
	Status    Status `json:"status"`
}

type FixtureResponse

type FixtureResponse struct {
	Team       Team        `json:"team"`
	Statistics []Statistic `json:"statistics"`
}

type FullFixtureResponse

type FullFixtureResponse struct {
	Get      string            `json:"get"`
	Errors   []interface{}     `json:"errors"`
	Results  int               `json:"results"`
	Paging   map[string]int    `json:"paging"`
	Response []FixtureResponse `json:"response"`
}

type FullResponseCurrentGameweek

type FullResponseCurrentGameweek struct {
	Get      string                    `json:"get"`
	Results  int                       `json:"results"`
	Paging   map[string]int            `json:"paging"`
	Response []CurrentGameweekResponse `json:"response"`
}

type FullStandingsResponse

type FullStandingsResponse struct {
	Get      string              `json:"get"`
	Results  int                 `json:"results"`
	Paging   map[string]int      `json:"paging"`
	Response []StandingsResponse `json:"response"`
}

standings structs

type Game

type Game struct {
	Id        int `gorm:"primaryKey"`
	AwayGoals int
	AwayTeam  string
	Date      string
	HomeGoals int
	HomeTeam  string
	Status    string
	Timestamp int
}

type GoalsScored

type GoalsScored struct {
	Home int `json:"home"`
	Away int `json:"away"`
}

type League

type League struct {
	Name      string       `json:"name"`
	Season    int          `json:"season"`
	Standings [][]Standing `json:"standings"` // Note: changed the type to a 2D slice of Standing
}

type RoundsResponse

type RoundsResponse struct {
	Response []string `json:"response"`
}

type Standing

type Standing struct {
	Rank      int  `json:"rank"`
	Team      Team `json:"team"`
	Points    int  `json:"points"`
	GoalsDiff int  `json:"goalsDiff"`
}

type StandingsResponse

type StandingsResponse struct {
	League League `json:"league"`
}

type Statistic

type Statistic struct {
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}

structs for singular fixture

type Status

type Status struct {
	LongVersion  string `json:"long"`
	ShortVersion string `json:"short"`
}

type Team

type Team struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type Teams

type Teams struct {
	Home Team `json:"home"`
	Away Team `json:"away"`
}

Jump to

Keyboard shortcuts

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