fixtures

package
v0.0.0-...-702d5d8 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 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 AverageCount

type AverageCount struct {
	Total   int     `mapstructure:"total"`
	Average float32 `mapstructure:"percentage"`
}

type AverageDetails

type AverageDetails struct {
	Home  float32 `mapstructure:"home"`
	Away  float32 `mapstructure:"away"`
	Total float32 `mapstructure:"total"`
}

type AverageGoals

type AverageGoals struct {
	Home float32 `mapstructure:"home"`
	Away float32 `mapstructure:"away"`
}

type Biggest

type Biggest struct {
	Streak Streak          `mapstructure:"streak"`
	Wins   BiggestScore    `mapstructure:"wins"`
	Loses  BiggestScore    `mapstructure:"loses"`
	Goals  GoalsForAgainst `mapstructure:"goals"`
}

type BiggestScore

type BiggestScore struct {
	Home string `mapstructure:"home"`
	Away string `mapstructure:"away"`
}

type CardsStats

type CardsStats struct {
	Yellow int `json:"yellow"`
	Red    int `json:"red"`
}

type Coach

type Coach struct {
	ID    int    `json:"id"`
	Name  string `json:"name"`
	Photo string `json:"photo"`
}

type Comparison

type Comparison struct {
	Form                Percent `mapstructure:"form"`
	Att                 Percent `mapstructure:"att"`
	Def                 Percent `mapstructure:"def"`
	PoissonDistribution Percent `mapstructure:"poisson_distribution"`
	H2H                 Percent `mapstructure:"h2h"`
	Goals               Percent `mapstructure:"goals"`
	Total               Percent `mapstructure:"total"`
}

type Details

type Details struct {
	Home  int `mapstructure:"home"`
	Away  int `mapstructure:"away"`
	Total int `mapstructure:"total"`
}

type DribblesStats

type DribblesStats struct {
	Attempts int `json:"attempts"`
	Success  int `json:"success"`
	Past     int `json:"past"`
}

type DuelsStats

type DuelsStats struct {
	Total int `json:"total"`
	Won   int `json:"won"`
}

type Event

type Event struct {
	Time     Time                    `json:"time"`
	Team     Team                    `json:"team"`
	Player   Player                  `json:"player"`
	Assist   Player                  `json:"assist"`
	Type     common.EventType        `json:"type"`
	Detail   common.EventTypeDetails `json:"detail"`
	Comments string                  `json:"comments"`
}

func (Event) IsFoul

func (e Event) IsFoul() bool

func (Event) IsPenaltyShootout

func (e Event) IsPenaltyShootout() bool

type Fixture

type Fixture struct {
	Fixture FixtureDetails `json:"fixture"`
	League  League         `json:"league"`
	Teams   Teams          `json:"teams"`
	Goals   Goals          `json:"goals"`
	Score   Score          `json:"score"`
	// This array of game events is returned even though it's not listed in the documentation
	Events []Event `json:"events"`
}

type FixtureDetails

type FixtureDetails struct {
	ID        int        `json:"id"`
	Referee   string     `json:"referee"`
	Timezone  string     `json:"timezone"`
	Date      time.Time  `json:"date"`
	Timestamp int        `json:"timestamp"`
	Periods   Periods    `json:"periods"`
	Venue     misc.Venue `json:"venue"`
	Status    Status     `json:"status"`
}

type FixturePrediction

type FixturePrediction struct {
	Winner    Team         `mapstructure:"winner"`
	WinOrDraw bool         `mapstructure:"win_or_draw"`
	UnderOver *float32     `mapstructure:"under_over"`
	Goals     AverageGoals `mapstructure:"goals"`
	Advice    string       `mapstructure:"advice"`
	Percent   Percent      `mapstructure:"percent"`
}

type FormData

type FormData struct {
	Played Details `mapstructure:"played"`
	Wins   Details `mapstructure:"wins"`
	Draws  Details `mapstructure:"draws"`
	Loses  Details `mapstructure:"loses"`
}

type Formation

type Formation struct {
	Defenders            int    `mapstructure:"D" json:"D"`
	DefenciveMidfielders int    `mapstructure:"DM" json:"DM"`
	Midfielders          int    `mapstructure:"M" json:"M"`
	AttackingMidfielders int    `mapstructure:"AM" json:"AM"`
	Forwards             int    `mapstructure:"F" json:"F"`
	Original             string `mapstructre:"original" json:"original"`
}

type FoulsStats

type FoulsStats struct {
	Drawn     int `json:"drawn"`
	Committed int `json:"committed"`
}

type GeneralStats

type GeneralStats struct {
	Minutes    int            `json:"minutes"`
	Number     int            `json:"number"`
	Position   LineupPosition `json:"position"`
	Rating     float32        `json:"rating"`
	Captain    bool           `json:"captain"`
	Substitute bool           `json:"substitute"`
}

type GoalAmount

type GoalAmount struct {
	Total   int     `mapstructure:"total"`
	Average float32 `mapstructure:"average"`
}

type GoalAmountData

type GoalAmountData struct {
	For     GoalAmount `mapstructure:"for"`
	Against GoalAmount `mapstructure:"against"`
}

type GoalStats

type GoalStats struct {
	Total    int `json:"total"`
	Conceded int `json:"conceded"`
	Assists  int `json:"assists"`
	Saves    int `json:"saves"`
}

type Goals

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

type GoalsForAgainst

type GoalsForAgainst struct {
	For     Goals `mapstructure:"for"`
	Against Goals `mapstructure:"against"`
}

type GridCell

type GridCell struct {
	Row    int `json:"row"`
	Column int `json:"column"`
}

type HeadToHead

type HeadToHead struct {
	Fixture FixtureDetails `json:"fixture"`
	League  League         `json:"league"`
	Teams   Teams          `json:"teams"`
	Goals   Goals          `json:"goals"`
	Score   Score          `json:"score"`
}

type KitColor

type KitColor struct {
	Primary string `json:"primary"`
	Number  string `json:"number"`
	Border  string `json:"border"`
}

type Last5

type Last5 struct {
	FormPercentage int            `mapstructure:"form"`
	AttPercentage  int            `mapstructure:"att"`
	DefPercentage  int            `mapstructure:"def"`
	Goals          GoalAmountData `mapstructure:"goals"`
}

type League

type League struct {
	ID      int     `json:"id"`
	Name    string  `json:"name"`
	Country string  `json:"country"`
	Flag    string  `json:"flag"`
	Season  int     `json:"season"`
	Round   *string `json:"round"`
}

type LeaguePerformance

type LeaguePerformance struct {
	Form          string           `mapstructure:"form"`
	FormData      FormData         `mapstructure:"fixtures"`
	Goals         team.Goals       `mapstructure:"goals"`
	Biggest       Biggest          `mapstructure:"biggest"`
	CleanSheet    Details          `mapstructure:"clean_sheet"`
	FailedToScore Details          `mapstructure:"failed_to_score"`
	PenaltyStats  TeamPenaltyStats `mapstructure:"penalty"`
	LineupUsage   []LineupUsage    `mapstructure:"lineups"`
	Cards         team.Cards       `mapstructure:"cards"`
}

type Lineup

type Lineup struct {
	Team        TeamLineup     `json:"team"`
	Formation   Formation      `json:"formation"`
	StartXI     []PlayerLineup `mapstructure:"startXI" json:"startXI"`
	Substitutes []PlayerLineup `json:"substitutes"`
	Coach       Coach          `json:"coach"`
}

type LineupPosition

type LineupPosition string
const (
	LineupPositionGoalkeeper          LineupPosition = "G"
	LineupPositionDefender            LineupPosition = "D"
	LineupPositionDefensiveMidfielder LineupPosition = "DM"
	LineupPositionMidfielder          LineupPosition = "M"
	LineupPositionAttackingMidfielder LineupPosition = "AM"
	LineupPositionForward             LineupPosition = "F"
)

type LineupUsage

type LineupUsage struct {
	Formation   string `mapstructure:"formation"`
	PlayedCount int    `mapstructure:"played"`
}

type PassesStats

type PassesStats struct {
	Total           int `json:"total"`
	Key             int `json:"key"`
	AccuracyPercent int `mapstructure:"accuracy" json:"accuracy"`
}

type PenaltyStats

type PenaltyStats struct {
	Won       int `json:"won"`
	Committed int `mapstructure:"commited" json:"committed"`
	Scored    int `json:"scored"`
	Missed    int `json:"missed"`
	Saved     int `json:"saved"`
}

type Percent

type Percent struct {
	Home int `mapstructure:"home"`
	Draw int `mapstructure:"draw"`
	Away int `mapstructure:"away"`
}

type Periods

type Periods struct {
	First  int `json:"first"`
	Second int `json:"second"`
}

type Player

type Player struct {
	ID    int    `json:"id"`
	Name  string `json:"name"`
	Photo string `mapstructure:"omitempty" json:"photo,omitempty"`
}

type PlayerGameStatistics

type PlayerGameStatistics struct {
	General  GeneralStats  `mapstructure:"games" json:"genaral"`
	Offsides int           `json:"offsides"`
	Shots    ShotsStats    `json:"shots"`
	Goals    GoalStats     `json:"goals"`
	Passes   PassesStats   `json:"passes"`
	Tackles  TacklesStats  `json:"tackles"`
	Duels    DuelsStats    `json:"duels"`
	Dribbles DribblesStats `json:"dribbles"`
	Fouls    FoulsStats    `json:"fouls"`
	Cards    CardsStats    `json:"cards"`
	Penalty  PenaltyStats  `json:"penalty"`
}

type PlayerLineup

type PlayerLineup struct {
	ID       int            `json:"id"`
	Name     string         `json:"name"`
	Number   int            `json:"number"`
	Position LineupPosition `mapstructure:"pos" json:"pos"`
	// For some reason this is always null
	Grid GridCell `json:"grid"`
}

type PlayerStatistics

type PlayerStatistics struct {
	Team    TeamBasic         `json:"team"`
	Players []TeamPlayerStats `mapstructure:"players" json:"players"`
}

type Predictions

type Predictions struct {
	Prediction FixturePrediction `mapstructure:"predictions"`
	League     League            `mapstructure:"league"`
	Teams      TeamStats         `mapstructure:"teams"`
	Comparison Comparison        `mapstructure:"comparison"`
	HeadToHead []HeadToHead      `mapstructure:"h2h"`
}

type Round

type Round struct {
	Name string `json:"name"`
}

type Score

type Score struct {
	Halftime  Goals `json:"halftime"`
	Fulltime  Goals `json:"fulltime"`
	Extratime Goals `json:"extratime"`
	Penalty   Goals `json:"penalty"`
}

type ShotsStats

type ShotsStats struct {
	Total int `json:"total"`
	On    int `json:"on"`
}

type Status

type Status struct {
	Long    string               `json:"long"`
	Value   common.FixtureStatus `json:"short"`
	Elapsed int                  `json:"elapsed"`
}

type Streak

type Streak struct {
	Wins  int `mapstructure:"wins"`
	Draws int `mapstructure:"draws"`
	Loses int `mapstructure:"loses"`
}

type TacklesStats

type TacklesStats struct {
	Total         int `json:"total"`
	Blocks        int `json:"blocks"`
	Interceptions int `json:"interceptions"`
}

type Team

type Team struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Winner *bool  `json:"winner"`
}

type TeamBasic

type TeamBasic struct {
	ID      int        `json:"id"`
	Name    string     `json:"name"`
	Updated *time.Time `mapstructue:"update,omitempty" json:"updated,omitempty"`
}

type TeamDetails

type TeamDetails struct {
	ID     int               `mapstructure:"id"`
	Name   string            `mapstructure:"name"`
	Last5  Last5             `mapstructure:"last_5"`
	League LeaguePerformance `mapstructure:"league"`
}

type TeamLineup

type TeamLineup struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	KitColors struct {
		FieldPlayer KitColor `mapstructure:"player" json:"player"`
		Goalkeeper  KitColor `json:"goalkeeper"`
	} `mapstructure:"colors" json:"colors"`
}

type TeamPenaltyStats

type TeamPenaltyStats struct {
	Scored AverageCount `mapstructure:"scored"`
	Missed AverageCount `mapstructure:"missed"`
	Total  int          `mapstructure:"total"`
}

type TeamPlayerStats

type TeamPlayerStats struct {
	Player     Player               `json:"player"`
	Statistics PlayerGameStatistics `json:"statistics"`
}

type TeamStatistic

type TeamStatistic struct {
	Type  common.StatsType `json:"type"`
	Value int              `json:"value"`
}

type TeamStatistics

type TeamStatistics struct {
	Team       TeamBasic       `json:"team"`
	Statistics []TeamStatistic `json:"statistics"`
}

type TeamStats

type TeamStats struct {
	Home TeamDetails `mapstructure:"home"`
	Away TeamDetails `mapstructure:"away"`
}

type Teams

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

type Time

type Time struct {
	Elapsed int `json:"elapsed"`
	Extra   int `json:"extra"`
}

type Venue

type Venue struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	City string `json:"city"`
}

Jump to

Keyboard shortcuts

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