football

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	Age            int    `graphql:"age"`
	AssetId        string `graphql:"assetId"`
	Name           string `graphql:"name"`
	BackPictureUrl string `graphql:"backPictureUrl"`
}

type CardsParams

type CardsParams struct {
	Age                   *int                   `graphql:"age"`
	AssetIds              []string               `graphql:"assetIds"`
	CustomCardEditionName *string                `graphql:"customCardEditionName"`
	Owned                 *bool                  `graphql:"owned"`
	OwnedSinceAfter       *types.ISO8601DateTime `graphql:"ownedSinceAfter"`
	PlayerSlugs           []string               `graphql:"playerSlugs"`
	Positions             []types.Position       `graphql:"positions"`
	Rarities              []types.Rarity         `graphql:"rarities"`
	SerialNumber          *int                   `graphql:"serialNumber"`
	ShirtNumber           *int                   `graphql:"shirtNumber"`
	Slugs                 []string               `graphql:"slugs"`
	TeamSlugs             []string               `graphql:"teamSlugs"`
}

type Club

type Club struct {
	Team
	DomesticLeague struct {
		Slug string `graphql:"slug"`
	} `graphql:"domesticLeague"`
}

type ClubGamesParams

type ClubGamesParams struct {
	StartDate types.ISO8601DateTime `graphql:"startDate"`
	EndDate   types.ISO8601DateTime `graphql:"endDate"`
}

type Competition

type Competition struct {
	Id          graphql.Id `graphql:"id"`
	DisplayName string     `graphql:"displayName"`
	Slug        string     `graphql:"slug"`
	Country     struct {
		Slug string `graphql:"slug"`
	} `graphql:"country"`
	Format               string `graphql:"format"`
	Type                 string `graphql:"type"`
	PictureUrl           string `graphql:"pictureUrl"`
	LogoUrl              string `graphql:"logoUrl"`
	BackgroundColor      string `graphql:"backgroundColor"`
	BackgroundPictureUrl string `graphql:"backgroundPictureUrl"`
	OpenForGameStats     bool   `graphql:"openForGameStats"`
	Released             bool   `graphql:"released"`
	Seasons              []struct {
		StartYear int `graphql:"startYear"`
	}
}

type Football

func NewFootball

func NewFootball(c *graphql.Client) *Football

func (*Football) NewClubActivePlayersQuery

func (f *Football) NewClubActivePlayersQuery(clubSlug string) *graphql.PaginatedQuery[Player, graphql.EmptyParams]

func (*Football) NewClubCardsQuery

func (f *Football) NewClubCardsQuery(clubSlug string) *graphql.PaginatedQuery[Card, CardsParams]

func (*Football) NewClubGamesQuery

func (f *Football) NewClubGamesQuery(clubSlug string) *graphql.PaginatedQuery[Game, ClubGamesParams]

func (*Football) NewClubPlayersQuery

func (f *Football) NewClubPlayersQuery(clubSlug string) *graphql.PaginatedQuery[Player, graphql.EmptyParams]

func (*Football) NewClubRecentDeparturesQuery

func (f *Football) NewClubRecentDeparturesQuery(clubSlug string) *graphql.PaginatedQuery[Player, graphql.EmptyParams]

func (*Football) NewCompetitionClubs

func (f *Football) NewCompetitionClubs(competitionSlug string) *graphql.PaginatedQuery[Club, graphql.EmptyParams]

func (*Football) NewCompetitionPlayersByLastFiveAverage

func (f *Football) NewCompetitionPlayersByLastFiveAverage(competitionSlug string) *graphql.PaginatedQuery[Player, graphql.EmptyParams]

func (*Football) NewPlayerCardsQuery

func (f *Football) NewPlayerCardsQuery(playerSlug string) *graphql.PaginatedQuery[Card, CardsParams]

func (*Football) NewPlayersGameScoresQuery

func (f *Football) NewPlayersGameScoresQuery(gameId gql.ID) *graphql.Query[[]PlayerScore, graphql.SlugsParams]

type Game

type Game struct {
	Id graphql.Id `graphql:"id"`

	AwayGoals int `graphql:"awayGoals"`
	AwayTeam  struct {
		TypeName string `graphql:"__typename"`
		Team     struct {
			Slug string `graphql:"slug"`
		} `graphql:"... on TeamInterface"`
	} `graphql:"awayTeam"`
	Competition struct {
		Slug string `graphql:"slug"`
	} `graphql:"competition"`
	CoverageStatus     string    `graphql:"coverageStatus"`
	Date               time.Time `graphql:"date"`
	ExtraTimeScoreAway int       `graphql:"extraTimeScoreAway"`
	ExtraTimeScoreHome int       `graphql:"extraTimeScoreHome"`

	HomeGoals int `graphql:"homeGoals"`
	HomeTeam  struct {
		TypeName string `graphql:"__typename"`
		Team     struct {
			Slug string `graphql:"slug"`
		} `graphql:"... on TeamInterface"`
	} `graphql:"homeTeam"`
	LowCoverage      bool   `graphql:"lowCoverage"`
	Minute           int    `graphql:"minute"`
	PenaltyScoreAway int    `graphql:"penaltyScoreAway"`
	PenaltyScoreHome int    `graphql:"penaltyScoreHome"`
	PeriodType       string `graphql:"periodType"`
	Scored           bool   `graphql:"scored"`
	So5Fixture       struct {
		Slug string `graphql:"slug"`
	} `graphql:"so5Fixture"`
	Status string `graphql:"status"`
	Winner struct {
		TypeName string `graphql:"__typename"`
		Team     struct {
			Slug string `graphql:"slug"`
		} `graphql:"... on TeamInterface"`
	} `graphql:"winner"`
}

type GameWithFormation

type GameWithFormation struct {
	Game
	AwayFormation struct {
		Bench []struct {
			Slug string `graphql:"slug"`
		} `graphql:"bench"`
		StartingLineup [][]struct {
			Slug string `graphql:"slug"`
		} `graphql:"startingLineup"`
	} `graphql:"awayFormation"`
	HomeFormation struct {
		Bench []struct {
			Slug string `graphql:"slug"`
		} `graphql:"bench"`
		StartingLineup [][]struct {
			Slug string `graphql:"slug"`
		} `graphql:"startingLineup"`
	} `graphql:"homeFormation"`
}

type Injury

type Injury struct {
	Id              graphql.Id `graphql:"id"`
	Active          bool       `graphql:"active"`
	StartDate       time.Time  `graphql:"startDate"`
	ExpectedEndDate time.Time  `graphql:"expectedEndDate"`
	Kind            string     `graphql:"kind"`
}

type NationalTeam

type NationalTeam struct {
	Team
	InternationalCompetition struct {
		Slug string `graphql:"slug"`
	} `graphql:"internationalCompetition"`
}

type Player

type Player struct {
	ActiveClub struct {
		Slug string `graphql:"slug"`
	} `graphql:"activeClub"`
	ActiveNationalTeam struct {
		Slug string `graphql:"slug"`
	} `graphql:"activeNationalTeam"`
	ActiveInjuries    []Injury         `graphql:"activeInjuries"`
	ActiveSuspensions []Suspension     `graphql:"activeSuspensions"`
	Age               int              `graphql:"age"`
	Appearances       int              `graphql:"appearances"`
	BestFoot          string           `graphql:"bestFoot"`
	BirthDate         time.Time        `graphql:"birthDate"`
	CardPositions     []types.Position `graphql:"cardPositions"`
	Id                graphql.Id       `graphql:"id"`
	Slug              string           `graphql:"slug"`
	DisplayName       string           `graphql:"displayName"`
	FirstName         string           `graphql:"firstName"`
	Height            int              `graphql:"height"`
	Injuries          []Injury         `graphql:"injuries"`
	LastClub          struct {
		Slug string `graphql:"slug"`
	} `graphql:"lastClub"`
	LastName      string                    `graphql:"lastName"`
	MatchName     string                    `graphql:"matchName"`
	PictureUrl    string                    `graphql:"pictureUrl"`
	PlayingStatus types.PlayerPlayingStatus `graphql:"playingStatus"`
	Country       struct {
		Slug string `graphql:"slug"`
	}
	AvatarUrl string `graphql:"avatar:pictureUrl(derivative:\"avatar\")"`

	Position    types.Position `graphql:"position"`
	ShirtNumber int            `graphql:"shirtNumber"`
	Suspensions []Suspension   `graphql:"suspensions"`
	User        struct {
		Slug string `graphql:"slug"`
	} `graphql:"user"`
	Weight int `graphql:"weight"`
}

type PlayerGameStats

type PlayerGameStats struct {
	AccuratePass       int                     `graphql:"accuratePass"`
	CleanSheet         int                     `graphql:"cleanSheet"`
	CrossAccuracy      int                     `graphql:"crossAccuracy"`
	DuelWon            int                     `graphql:"duelWon"`
	EffectiveClearance int                     `graphql:"effectiveClearance"`
	FieldStatus        types.PlayerFieldStatus `graphql:"fieldStatus"`
	FormationPlace     int                     `graphql:"formationPlace"`
	Fouls              int                     `graphql:"fouls"`
	Game               struct {
		Id graphql.Id `graphql:"id"`
	} `graphql:"game"`
	GameStarted        int        `graphql:"gameStarted"`
	GoalAssist         int        `graphql:"goalAssist"`
	GoalKicks          int        `graphql:"goalKicks"`
	Goals              int        `graphql:"goals"`
	GoalsConceded      int        `graphql:"goalsConceded"`
	Id                 graphql.Id `graphql:"id"`
	Live               bool       `graphql:"live"`
	LostCorners        int        `graphql:"lostCorners"`
	MinsPlayed         int        `graphql:"minsPlayed"`
	OnGameSheet        bool       `graphql:"onGameSheet"`
	OntargetScoringAtt int        `graphql:"ontargetScoringAtt"`
	OwnGoals           int        `graphql:"ownGoals"`
	Parries            int        `graphql:"parries"`
	PassAccuracy       int        `graphql:"passAccuracy"`
	PenaltiesSaved     int        `graphql:"penaltiesSaved"`
	PenaltyKickMissed  int        `graphql:"penaltyKickMissed"`
	PenaltySave        int        `graphql:"penaltySave"`
	Player             struct {
		Slug string `graphql:"slug"`
	} `graphql:"player"`
	RedCard        int  `graphql:"redCard"`
	Reviewed       bool `graphql:"reviewed"`
	Saves          int  `graphql:"saves"`
	ShotAccuracy   int  `graphql:"shotAccuracy"`
	ShotEfficiency int  `graphql:"shotEfficiency"`
	SingleGoalGame int  `graphql:"singleGoalGame"`
	Team           struct {
		Slug string `graphql:"slug"`
	} `graphql:"team"`
	TotalClearance  int `graphql:"totalClearance"`
	TotalPass       int `graphql:"totalPass"`
	TotalScoringAtt int `graphql:"totalScoringAtt"`
	TotalTackle     int `graphql:"totalTackle"`
	WasFouled       int `graphql:"wasFouled"`
	WonContest      int `graphql:"wonContest"`
	YellowCard      int `graphql:"yellowCard"`
}

type PlayerScore

type PlayerScore struct {
	Slug     string   `graphql:"slug"`
	So5Score So5Score `graphql:"so5Score(gameId:$gameId)"`
}

type Season

type Season struct {
	Id        graphql.Id `graphql:"id"`
	Name      string     `graphql:"name"`
	StartYear int        `graphql:"startYear"`
}

type SeasonParams

type SeasonParams struct {
	StartYear int `graphql:"startYear"`
}

type So5

type So5 struct {
	So5Fixture     *graphql.Query[So5Fixture, So5FixtureParams]
	So5Fixtures    *graphql.PaginatedQuery[So5Fixture, So5FixturesParams]
	So5Score       *graphql.Query[So5Score, graphql.IdParams]
	So5Leaderboard *graphql.Query[So5Leaderboard, graphql.SlugParams]

	UpcomingLeaderboards *graphql.Query[[]So5Leaderboard, UpcomingLeaderboardsParams]
	// contains filtered or unexported fields
}

func NewSo5

func NewSo5(c *graphql.Client) *So5

func (*So5) NewSo5FixtureGamesQuery

func (s *So5) NewSo5FixtureGamesQuery(
	so5FixtureSlug string,
) *graphql.Query[[]Game, graphql.EmptyParams]

type So5Fixture

type So5Fixture struct {
	AasmState       string     `graphql:"aasmState"`
	CanCompose      bool       `graphql:"canCompose"`
	CutOffDate      time.Time  `graphql:"cutOffDate"`
	DisplayName     string     `graphql:"displayName"`
	EndDate         time.Time  `graphql:"endDate"`
	EventType       string     `graphql:"eventType"`
	GameWeek        int        `graphql:"gameWeek"`
	Id              graphql.Id `graphql:"id"`
	ReplayedFixture struct {
		Slug string `graphql:"slug"`
	} `graphql:"replayedFixture"`
	RewardsDeliveryDate time.Time `graphql:"rewardsDeliveryDate"`
	ShortDisplayName    string    `graphql:"shortDisplayName"`
	Slug                string    `graphql:"slug"`
	StartDate           time.Time `graphql:"startDate"`
}

type So5FixtureParams

type So5FixtureParams struct {
	Id   *gql.ID         `graphql:"id"`
	Slug *string         `graphql:"slug"`
	Type *types.So5State `graphql:"type"`
}

type So5FixturesParams

type So5FixturesParams struct {
	AasmStates []string `graphql:"aasmStates"`
}

type So5Leaderboard

type So5Leaderboard struct {
	CutOffDate           time.Time                `graphql:"cutOffDate"`
	DefaultAverageScore  types.AveragePlayerScore `graphql:"defaultAverageScore"`
	Description          string                   `graphql:"description"`
	DisplayName          string                   `graphql:"displayName"`
	ShortDisplayName     string                   `graphql:"shortDisplayName:displayName(short:true)"`
	Division             int                      `graphql:"division"`
	EndDate              time.Time                `graphql:"endDate"`
	GameWeek             int                      `graphql:"gameWeek"`
	IconUrl              string                   `graphql:"iconUrl"`
	Id                   graphql.Id               `graphql:"id"`
	MainRarityType       types.Rarity             `graphql:"mainRarityType"`
	PowerCap             float64                  `graphql:"powerCap"`
	RarityType           string                   `graphql:"rarityType"`
	RewardedLineupsCount int                      `graphql:"rewardedLineupsCount"`
	Slug                 string                   `graphql:"slug"`
	So5Fixture           struct {
		Slug string `graphql:"slug"`
	} `graphql:"so5Fixture"`
	So5LeaderBoardType types.So5LeaderboardType `graphql:"so5LeaderboardType"`
	So5League          struct {
		Slug string `graphql:"slug"`
	} `graphql:"so5League"`
	So5LineupsCount   int           `graphql:"so5LineupsCount"`
	So5TournamentType So5Tournament `graphql:"so5TournamentType"`
	StartDate         time.Time     `graphql:"startDate"`
	SvgLogoUrl        string        `graphql:"svgLogoUrl"`
	TeamsCap          int           `graphql:"teamsCap"`
	Title             string        `graphql:"title"`
	TournamentType    string        `graphql:"tournamentType"`
	TrainingCenter    bool          `graphql:"trainingCenter"`
}

type So5Score

type So5Score struct {
	AllAroundStats []StatScore `graphql:"allAroundStats"`
	DecisiveScore  StatScore   `graphql:"decisiveScore"`
	DetailedScore  []StatScore `graphql:"detailedScore"`
	Game           struct {
		Id graphql.Id `graphql:"id"`
	} `graphql:"game"`
	Id                    graphql.Id  `graphql:"id"`
	NegativeDecisiveStats []StatScore `graphql:"negativeDecisiveStats"`
	Player                struct {
		Slug string `graphql:"slug"`
	} `graphql:"player"`
	Position              string          `graphql:"position"`
	PositionTyped         types.Position  `graphql:"positionTyped"`
	PositiveDecisiveStats []StatScore     `graphql:"positiveDecisiveStats"`
	Score                 decimal.Decimal `graphql:"score"`
	ScoringVersion        int             `graphql:"scoringVersion"`
}

type So5Tournament

type So5Tournament struct {
	Id                 string                   `graphql:"id"`
	DisplayName        string                   `graphql:"displayName"`
	ShortDisplayName   string                   `graphql:"shortDisplayName:displayName(short:true)"`
	So5LeaderboardType types.So5LeaderboardType `graphql:"so5LeaderboardType"`
	SvgLogoUrl         string                   `graphql:"svgLogoUrl"`
}

type StatScore

type StatScore struct {
	Category   types.StatCategory `graphql:"category"`
	Points     decimal.Decimal    `graphql:"points"`
	Stat       string             `graphql:"stat"`
	StatValue  decimal.Decimal    `graphql:"statValue"`
	TotalScore decimal.Decimal    `graphql:"totalScore"`
}

type Suspension

type Suspension struct {
	Id          graphql.Id `graphql:"id"`
	Active      bool       `graphql:"active"`
	StartDate   time.Time  `graphql:"startDate"`
	EndDate     time.Time  `graphql:"endDate"`
	Kind        string     `graphql:"kind"`
	Matches     int        `graphql:"matches"`
	Reason      string     `graphql:"reason"`
	Competition struct {
		Slug string `graphql:"slug"`
	} `graphql:"competition"`
}

type Team

type Team struct {
	ActiveCompetitions []struct {
		Slug string `graphql:"slug"`
	} `graphql:"activeCompetitions"`
	Code    string `graphql:"code"`
	Country struct {
		Slug string `graphql:"slug"`
	}
	Founded             string `graphql:"founded"`
	Name                string `graphql:"name"`
	PictureSecondaryUrl string `graphql:"pictureSecondaryUrl"`
	PictureUrl          string `graphql:"pictureUrl"`
	Ready               bool   `graphql:"ready"`
	ShortName           string `graphql:"shortName"`
	Slug                string `graphql:"slug"`
}

type UpcomingLeaderboardsParams

type UpcomingLeaderboardsParams struct {
	Rarities []types.So5LeaderboardRarity `graphql:"rarities"`
}

Jump to

Keyboard shortcuts

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