model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EPL        = "EPL"
	LA_LIGA    = "La_liga"
	BUNDESLIGA = "Bundesliga"
	SERIE_A    = "Serie_A"
	LIGUE_1    = "Ligue_1"
	RFPL       = "RFPL"
)
View Source
const (
	PLAYERS = "playersData"
	TEAMS   = "teamsData"
	GAMES   = "datesData"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Forecast

type Forecast struct {
	Win  json.Number `json:"w"`
	Draw json.Number `json:"d"`
	Loss json.Number `json:"l"`
}

type Game

type Game struct {
	Id        json.Number `json:"id"`
	HasResult bool        `json:"isResult"`
	HomeTeam  Team        `json:"h"`
	AwayTeam  Team        `json:"a"`
	Goals     Goals       `json:"goals"`
	XGs       XGs         `json:"xG"`
	Datetime  string      `json:"datetime"`
	Forecast  Forecast    `json:"forecast"`
}

type Games

type Games []Game

type Goals

type Goals struct {
	Home json.Number `json:"h"`
	Away json.Number `json:"a"`
}

type History

type History struct {
	HA          string  `json:"h_a"`
	XG          float64 `json:"xG"`
	XGA         float64 `json:"xGA"`
	NpxG        float64 `json:"npxG"`
	NpxGA       float64 `json:"npxGA"`
	PPDA        PPDA    `json:"ppda"`
	PPDAAllowed PPDA    `json:"ppda_allowed"`
	Deep        int     `json:"deep"`
	DeepAllowed int     `json:"deep_allowed"`
	Scored      int     `json:"scored"`
	Missed      int     `json:"missed"`
	Xpts        float64 `json:"xpts"`
	Result      string  `json:"result"`
	Date        string  `json:"date"`
	Wins        int     `json:"wins"`
	Draws       int     `json:"draws"`
	Loses       int     `json:"loses"`
	Pts         int     `json:"pts"`
	NpxGD       float64 `json:"npxGD"`
}

type League

type League string

type LeagueBundle

type LeagueBundle struct {
	Page  *Page
	Model LeagueModel
}

type LeagueModel

type LeagueModel struct {
	Players *Players
	Teams   *Teams
	Games   *Games
}

type LeaguePerYear

type LeaguePerYear map[Year]*LeagueBundle

type PPDA

type PPDA struct {
	Att int `json:"att"`
	Def int `json:"def"`
}

Define the structure for the nested objects in the JSON

type Page

type Page struct {
	Url      string
	Contents []byte
}

func NewPage

func NewPage(url string, contents []byte) *Page

func (*Page) GetGames

func (p *Page) GetGames() (*Games, error)

func (*Page) GetPlayers

func (p *Page) GetPlayers() (*Players, error)

func (*Page) GetTeams

func (p *Page) GetTeams() (*Teams, error)

type Player

type Player struct {
	Id        json.Number `json:"id"`
	Name      string      `json:"player_name"`
	Games     json.Number `json:"games"`
	Time      json.Number `json:"time"`
	Goals     json.Number `json:"goals"`
	XG        json.Number `json:"xG"`
	Assists   json.Number `json:"assists"`
	XA        json.Number `json:"xA"`
	Shots     json.Number `json:"shots"`
	KeyPasses json.Number `json:"key_passes"`
	Yellows   json.Number `json:"yellow_cards"`
	Reds      json.Number `json:"cards"`
	Position  string      `json:"position"`
	Team      string      `json:"team_title"`
	Npg       json.Number `json:"npg"`
	NpxG      json.Number `json:"npxG"`
	XGChain   json.Number `json:"xGChain"`
	XGBuildup json.Number `json:"xGBuildup"`
}

type Players

type Players []Player

type Team

type Team struct {
	ID      string    `json:"id"`
	Title   string    `json:"title"`
	History []History `json:"history"`
}

type Teams

type Teams []Team

type XGs

type XGs struct {
	Home json.Number `json:"h"`
	Away json.Number `json:"a"`
}

type Year

type Year int

Jump to

Keyboard shortcuts

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