onlineliga

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name        = iota
	Country     = iota
	TeamName    = iota
	Age         = iota
	Position    = iota
	Weight      = iota
	Height      = iota
	BirthWeek   = iota
	MarketValue = iota
	Foot        = iota
	Salary      = iota
	Contract    = iota
	Loyalty     = iota
	Bookings    = iota
)

profile mapping

Variables

This section is empty.

Functions

func TeamPlayers

func TeamPlayers(team *Team, teamSquadDoc *goquery.Document)

Types

type Booking

type Booking struct {
	PlayerID int    `json:"player_id"`
	Colour   string `json:"colour"`
	Minute   int    `json:"minute"`
}

type Goal

type Goal struct {
	Minute int    `json:"minute"`
	Type   string `json:"type"`
	Scorer int    `json:"scorer"`
	Assist int    `json:"assist"`
}

type League

type League struct {
	ID    int    `json:"league_id"`
	Name  string `json:"league_name"`
	Teams []Team `json:"teams"`
}

func (*League) GetName

func (league *League) GetName(leagueDocument *goquery.Document)

func (*League) GetTeams

func (league *League) GetTeams(leagueDocument *goquery.Document)

type LineUp

type LineUp struct {
	TeamID    int            `json:"team_id"`
	Team      string         `json:"team_name"`
	Formation string         `json:"formation"`
	Squad     map[string]int `json:"squad"`
}

type Match

type Match struct {
	ID          int         `json:"match_id"`
	Season      int         `json:"season"`
	Matchday    int         `json:"matchday"`
	Attendance  int         `json:"attendance"`
	Competition string      `json:"competition"`
	Date        time.Time   `json:"date"`
	LineUps     []LineUp    `json:"line_ups"`
	Statistics  []Statistic `json:"statistics"`
}

func (*Match) FetchStatistic

func (match *Match) FetchStatistic(matchDoc *goquery.Document)

type Player

type Player struct {
	ID               int                `json:"id"`
	TeamID           int                `json:"team_id"`
	Name             string             `json:"name"`
	Country          string             `json:"country"`
	BirthSeason      float64            `json:"birth_season"` // 24
	BirthWeek        float64            `json:"birth_week"`   // 38
	Salary           float64            `json:"salary"`       // -
	MarketValue      float64            `json:"market_value"` // -
	Weight           float64            `json:"weight"`       // 35
	Height           float64            `json:"height"`       // 27
	Talent           float64            `json:"talent"`
	Fitness          float64            `json:"fitness"`
	Overall          float64            `json:"overall"`
	TalentDiscovered bool               `json:"talent_discovered"`
	ContractExpiring bool               `json:"contract_expiring"`
	Positions        []string           `json:"positions"`
	Abilities        map[string]float64 `json:"abilities"`
}

func (Player) Age

func (player Player) Age() float64

func (*Player) GetProfile

func (player *Player) GetProfile(profileDoc *goquery.Document)

func (*Player) GetTeamID

func (player *Player) GetTeamID(profileDoc *goquery.Document)

type Statistic

type Statistic struct {
	TeamID        int            `json:"team_id"`
	Team          string         `json:"team_name"`
	Possession    int            `json:"ball_possession"`
	Attempts      int            `json:"goal_attempts"`
	Tackles       int            `json:"tackles"`
	Corners       int            `json:"corners"`
	Goals         []Goal         `json:"goals"`
	Bookings      []Booking      `json:"bookings"`
	Substitutions []Substitution `json:"substitution"`
}

type Substitution

type Substitution struct {
	PlayerInID  int    `json:"player_in_id"`
	PlayerOutID int    `json:"player_out_id"`
	Minute      string `json:"minute"`
}

type Team

type Team struct {
	ID      int      `json:"team_id"`
	Name    string   `json:"team_name"`
	Players []Player `json:"players"`
}

func (Team) Age

func (team Team) Age() (float64, float64)

func (Team) ExpiringContracts

func (team Team) ExpiringContracts() int

func (*Team) GetName

func (team *Team) GetName(teamInfoDoc *goquery.Document)

func (*Team) GetPlayers

func (team *Team) GetPlayers(teamSquadDoc *goquery.Document)

func (Team) MarketValue

func (team Team) MarketValue() (float64, float64)

team functions

func (Team) PlayersByPosition

func (team Team) PlayersByPosition(positions []string) []Player

func (Team) Salary

func (team Team) Salary() (float64, float64)

func (Team) Top15Players

func (team Team) Top15Players() []Player

Jump to

Keyboard shortcuts

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