openLigaDbClient

package
v0.0.0-...-d7ff19b Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResultHalftime = 1 // ResultHalftime is the points as of half-time-break
	ResultEnd      = 2 // ResultEnd is the result at the end of the regular 90 minutes
	ResultExtended = 3 // ResultExtended is the result after time extensions (this happens if the match had delays)
	ResultOvertime = 4 // ResultOvertime is the result after overtime (which happens when there is no winner after extended time)
	ResultEleven   = 5 // ResultEleven is the result after 11-meter-shooting (which happens when there is no winner after overtime)
)

Result types

Variables

This section is empty.

Functions

func ParseTime

func ParseTime(timeStr string) (time.Time, error)

ParseTime parses the timestamps from the API into a time.Time

Types

type Goal

type Goal struct {
	GoalID         int    `json:"goalID"`
	ScoreTeam1     int    `json:"scoreTeam1"` // ScoreTeam1 is team1's score after the goal
	ScoreTeam2     int    `json:"scoreTeam2"` // ScoreTeam2 is team2's score after the goal
	MatchMinute    int    `json:"matchMinute"`
	GoalGetterID   int    `json:"goalGetterID"`
	GoalGetterName string `json:"goalGetterName"`
	IsPenalty      bool   `json:"isPenalty"`  // IsPenalty is true if the goal was scored on a penalty shot
	IsOwnGoal      bool   `json:"isOwnGoal"`  // IsOwnGoal is true if the goal was shot by a player on their own team's goal
	IsOvertime     bool   `json:"isOvertime"` // IsOvertime is true if this goal was scored during overtime
	Comment        string `json:"comment"`
}

Goal is a goal entry

type Group

type Group struct {
	GroupName    string `json:"groupName"`
	GroupOrderID int    `json:"groupOderID"`
	GroupID      int    `json:"groupID"`
}

Group is a OpenLigaDB-Group (aka. League)

type Match

type Match struct {
	MatchID            int           `json:"matchID"`
	MatchDateTime      string        `json:"matchDateTime"`
	TimeZoneID         string        `json:"timeZoneID"`
	LeagueID           int           `json:"leagueId"`
	LeagueName         string        `json:"leagueName"`
	LeagueSeason       int           `json:"leagueSeason"`
	LeagueShortcut     string        `json:"leagueShortcut"`
	MatchDateTimeUTC   string        `json:"matchDateTimeUTC"`
	Group              Group         `json:"group"`
	Team1              Team          `json:"team1"`
	Team2              Team          `json:"team2"`
	LastUpdateDatetime string        `json:"lastUpdateDateTime"`
	MatchIsFinished    bool          `json:"matchIsFinished"`
	MatchResults       []MatchResult `json:"matchResults"`
	Goals              []Goal        `json:"goals"`

	Location        interface{} `json:"location"`
	NumberOfViewers interface{} `json:"numberOfViewers"`
}

Match combines all data on a match. The match may be planned, ongoing or finished

func GetMatchByID

func GetMatchByID(id int) (*Match, error)

GetMatchByID gets a specific match

func GetMatchesByLeague

func GetMatchesByLeague(league string) ([]Match, error)

GetMatchesByLeague finds all matches in a given league

type MatchResult

type MatchResult struct {
	ResultID          int    `json:"resultID"`
	ResultName        string `json:"resultName"`
	PointsTeam1       int    `json:"pointsTeam1"`
	PointsTeam2       int    `json:"pointsTeam2"`
	ResultOrderID     int    `json:"resultOrderID"`
	ResultTypeID      int    `json:"resultTypeID"` // See ResultHalftime, ResultEnd, ResultExtended, ResultOvertime and ResultEleven
	ResultDescription string `json:"resultDescription"`
}

MatchResult is a result entry

type Team

type Team struct {
	TeamID        int    `json:"teamId"`
	TeamName      string `json:"teamName"`
	ShortName     string `json:"shortName"`
	TeamIconURL   string `json:"teamIconUrl"`
	TeamGroupName string `json:"teamGroupName"`
}

Team is a OpenLigaDB-Team

Jump to

Keyboard shortcuts

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