pandascore

package module
v0.0.0-...-cea206e Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: MIT Imports: 7 Imported by: 0

README

pandascoresdk

Pandascore SDK for Golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// BaseURL is used to simplify queries paths. It is basically the common part for all the requests.
	BaseURL string
	APIKey  string

	HTTPClient *http.Client
}

Backend is the internal implementation for making HTTP requests to the Pandascore API. It handles everything from the authentication to returning the queries results.

func NewBackend

func NewBackend(APIKey string, httpClient *http.Client) *Backend

NewBackend created and returns a new backend ready to be used and query the PandaScore api.

func (*Backend) Call

func (b *Backend) Call(method string, path string, params Params, respContainer interface{}) error

Call is the entry point for the library to communicate with the Pandascore API. It is the function orchestrating the preparation of the query and the execution.

func (*Backend) Do

func (b *Backend) Do(req *http.Request, respContainer interface{}) error

Do is the function used in the library to execute the query and start the HTTP call. It is not involved for any formatting nor preparation of the query but is doing the execution per itself.

func (*Backend) NewRequest

func (b *Backend) NewRequest(method string, path string, params Params) (*http.Request, error)

NewRequest is the function formatting and preparing the request. It is not doing the query per itself not any execution.

type EmptyParams

type EmptyParams struct {
}

EmptyParams is internally used when willing not to pass params

func (*EmptyParams) StringifyParams

func (p *EmptyParams) StringifyParams() string

StringifyParams on emptyParams return an empty string to implement the Params interface

type League

type League struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	Slug      string `json:"slug"`
	VideoGame struct {
		ID             int    `json:"id"`
		CurrentVersion string `json:"current_version"`
		Name           string `json:"name"`
		Slug           string `json:"slug"`
	} `json:"videogame"`
	Series []struct {
		ID          int       `json:"id"`
		LeagueID    int       `json:"league_id"`
		Name        string    `json:"name"`
		FullName    string    `json:"full_name"`
		Description string    `json:"description"`
		Season      string    `json:"season"`
		Slug        string    `json:"slug"`
		Tier        string    `json:"tier"`
		WinnerID    int       `json:"winner_id"`
		WinnerType  string    `json:"winner_type"`
		Year        int       `json:"year"`
		BeginAt     time.Time `json:"begin_at"`
		EndAt       time.Time `json:"end_at"`
		ModifiedAt  time.Time `json:"modified_at"`
	} `json:"series"`
	URL        string    `json:"url"`
	ImageURL   string    `json:"image_url"`
	ModifiedAt time.Time `json:"modified_at"`
}

League is the resource as defined in the PandaScore API. More details can be found here : https://developers.pandascore.co/doc/#operation/get_leagues_leagueIdOrSlug

type LeagueFilterField

type LeagueFilterField string

LeagueFilterField defines the values usable to filter on leagues.

const (
	// LeagueListFilterID can be set to Filter on the id field
	LeagueListFilterID LeagueFilterField = "id"
	// LeagueListFilterModifiedAt can be set to Filter on the modified_at field
	LeagueListFilterModifiedAt LeagueFilterField = "modified_at"
	// LeagueListFilterName can be set to Filter on the name field
	LeagueListFilterName LeagueFilterField = "name"
	// LeagueListFilterSlug can be set to Filter on the slug field
	LeagueListFilterSlug LeagueFilterField = "slug"
	// LeagueListFilterURL can be set to Filter on the url field
	LeagueListFilterURL LeagueFilterField = "url"
)

type LeagueListParams

type LeagueListParams struct {
	VideoGame    VideoGameParam
	PageParams   *PageParams
	SortParams   []LeagueSortField
	RangeParams  map[LeagueRangeField]Range
	SearchParams map[LeagueSearchField]string
	FilterParams map[LeagueFilterField]string
}

LeagueListParams contains all the possibilities usable to customize the query on listing the leagues. All the fields are independant and optionnal.

func (*LeagueListParams) StringifyParams

func (p *LeagueListParams) StringifyParams() string

StringifyParams generates a string with all the parameters and/or default values to be then usable in the query url.

type LeagueRangeField

type LeagueRangeField string

LeagueRangeField defines the values usable to range on leagues.

const (
	// LeagueRangeID can be set to range on id
	LeagueRangeID LeagueRangeField = "id"
	// LeagueRangeModifiedAt can be set to range on modified_at
	LeagueRangeModifiedAt LeagueRangeField = "modified_at"
	// LeagueRangeName can be set to range on name
	LeagueRangeName LeagueRangeField = "name"
	// LeagueRangeSlug can be set to range on slug
	LeagueRangeSlug LeagueRangeField = "slug"
	// LeagueRangeURL can be set to range on url
	LeagueRangeURL LeagueRangeField = "url"
)

type LeagueSearchField

type LeagueSearchField string

LeagueSearchField defines the values usable to search on leagues.

const (
	// LeagueListSearchName can be set to search on the name field
	LeagueListSearchName LeagueSearchField = "name"
	// LeagueListSearchSlug can be set to search on the slug field
	LeagueListSearchSlug LeagueSearchField = "slug"
	// LeagueListSearchURL can be set to search on the url field
	LeagueListSearchURL LeagueSearchField = "url"
)

type LeagueSortField

type LeagueSortField string

LeagueSortField deines the values usable to sort on leagues.

const (
	// LeagueSortIDAsc can be set to sort per id asc order
	LeagueSortIDAsc LeagueSortField = "id"
	// LeagueSortIDDesc can be set to sort per id desc order
	LeagueSortIDDesc LeagueSortField = "-id"
	// LeagueSortModifiedAtAsc can be set to sort per modifed at value asc order
	LeagueSortModifiedAtAsc LeagueSortField = "modified_at"
	// LeagueSortModifiedAtDesc can be set to sort per  modifed at value desc order
	LeagueSortModifiedAtDesc LeagueSortField = "-modified_at"
	// LeagueSortNameAsc can be set to sort per name asc order
	LeagueSortNameAsc LeagueSortField = "name"
	// LeagueSortNameDesc can be set to sort per name desc order
	LeagueSortNameDesc LeagueSortField = "-name"
	// LeagueSortSlugAsc can be set to sort per slug asc order
	LeagueSortSlugAsc LeagueSortField = "slug"
	// LeagueSortSlugDesc can be set to sort per slug desc order
	LeagueSortSlugDesc LeagueSortField = "-slug"
	// LeagueSortURLAsc can be set to sort per url asc order
	LeagueSortURLAsc LeagueSortField = "url"
	// LeagueSortURLDesc can be set to sort per url desc order
	LeagueSortURLDesc LeagueSortField = "-url"
)

type Match

type Match struct {
	ID            int    `json:"id"`
	LeagueID      int    `json:"league_id"`
	SerieID       int    `json:"serie_id"`
	TournamentID  int    `json:"tournamend_id"`
	Name          string `json:"name"`
	Slug          string `json:"slug"`
	Forfeit       bool   `json:"forfeit"`
	DetailedStats bool   `json:"detailed_stats"`
	Draw          bool   `json:"draw"`
	MatchType     string `json:"match_type"`
	NumberOfGames int    `json:"number_of_games"`
	GameAdvantage int    `json:"game_advantage"`
	Status        string `json:"status"` // in "canceled" "finished" "not_started" "postponed" "running"
	Live          struct {
		OpensAt   string `json:"opens_at"`
		Supported bool   `json:"supported"`
		URL       string `json:"url"`
	} `json:"live"`
	League struct {
		ID         int       `json:"id"`
		Name       string    `json:"name"`
		Slug       string    `json:"slug"`
		URL        string    `json:"url"`
		ImageURL   string    `json:"image_url"`
		ModifiedAt time.Time `json:"modified_at"`
	} `json:"league"`
	Serie struct {
		ID          int       `json:"id"`
		LeagueID    int       `json:"league_id"`
		FullName    string    `json:"full_name"`
		Name        string    `json:"name"`
		Slug        string    `json:"slug"`
		Description string    `json:"description"`
		Season      string    `json:"string"`
		Tier        string    `json:"tier"`
		WinnerID    int       `json:"winner_id"`
		WinnerType  string    `json:"winner_type"`
		Year        int       `json:"year"`
		BeginAt     time.Time `json:"begin_at"`
		EndAt       time.Time `json:"end_at"`
		ModifiedAt  time.Time `json:"modified_at"`
	} `json:"serie"`
	Opponents []struct {
		Opponent struct {
			ID         int       `json:"id"`
			Acronym    string    `json:"acronym"`
			Name       string    `json:"name"`
			Slug       string    `json:"slug"`
			ImageURL   string    `json:"image_url"`
			Location   string    `json:"location"`
			ModifiedAt time.Time `json:"modified_at"`
		} `json:"opponent"`
		Type string `json:"type"`
	} `json:"opponents"`
	Games []struct {
		ID            int    `json:"id"`
		MatchID       int    `json:"match_id"`
		Length        int    `json:"length"`
		Finished      bool   `json:"finished"`
		DetailedStats bool   `json:"detailed_stats"`
		Forfeit       bool   `json:"forfeit"`
		Complete      bool   `json:"complete"`
		Position      int    `json:"position"`
		VideoURL      string `json:"video_url"`
		Winner        struct {
			ID   int    `json:"id"`
			Type string `json:"type"`
		} `json:"winner"`
		WinnerType string    `json:"winner_type"`
		Status     string    `json:"status"` // in "finished" "not_played" "not_started" "running"
		BeginAt    time.Time `json:"begin_at"`
		EndAt      time.Time `json:"end_at"`
	} `json:"games"`
	Tournament struct {
		ID            int       `json:"id"`
		LeagueID      int       `json:"league_id"`
		SerieID       int       `json:"serie_id"`
		Name          string    `json:"name"`
		Slug          string    `json:"slug"`
		LiveSupported bool      `json:"live_supported"`
		PrizePool     string    `json:"prizepool"`
		WinnerID      int       `json:"winner_id"`
		WinnerType    string    `json:"winner_type"`
		ModifiedAt    time.Time `json:"modified_at"`
		BeginAt       time.Time `json:"begin_at"`
		EndAt         time.Time `json:"end_at"`
	} `json:"tournament"`
	Winner struct {
		ID         int       `json:"id"`
		Acronym    string    `json:"acronym"`
		Name       string    `json:"name"`
		Slug       string    `json:"slug"`
		ImageURL   string    `json:"image_url"`
		Location   string    `json:"location"`
		ModifiedAt time.Time `json:"modified_at"`
	} `json:"winner"`
	WinnerID int `json:"winner_id"`
	Results  []struct {
		Score  int `json:"score"`
		TeamID int `json:"team_id"`
	} `json:"results"`
	Streams struct {
		English struct {
			EmbedURL string `json:"embed_url"`
			RawURL   string `json:"raw_url"`
		} `json:"english"`
		Original struct {
			EmbedURL string `json:"embed_url"`
			RawURL   string `json:"raw_url"`
		} `json:"original"`
		Russian struct {
			EmbedURL string `json:"embed_url"`
			RawURL   string `json:"raw_url"`
		} `json:"russian"`
	} `json:"streams"`
	VideoGame struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
		Slug string `json:"slug"`
	} `json:"videogame"`
	VideoGameVersion struct {
		Current bool   `json:"current"`
		Name    string `json:"name"`
	} `json:"video_game_version"`
	Rescheduled         bool      `json:"rescheduled"`
	ScheduledAt         time.Time `json:"scheduled_at"`
	OriginalScheduledAt time.Time `json:"original_scheduled_at"`
	BeginAt             time.Time `json:"begin_at"`
	EndAt               time.Time `json:"end_at"`
	ModifiedAt          time.Time `json:"modified_at"`
}

Match is the resource as defined in the PandaScore API. More details can be found here : https://developers.pandascore.co/doc/index.htm#operation/get_matches

type MatchFilterField

type MatchFilterField string

MatchFilterField defines the values usable to filter on matche.

const (
	// MatchListFilterID can be set to Filter on the id field
	MatchListFilterID MatchFilterField = "id"
	// MatchListFilterLeagueID can be set to Filter on the league_id field
	MatchListFilterLeagueID MatchFilterField = "league_id"
	// MatchListFilterSerieID can be set to Filter on the serie_id field
	MatchListFilterSerieID MatchFilterField = "serie_id"
	// MatchListFilterTournamentID can be set to Filter on the tournament_id field
	MatchListFilterTournamentID MatchFilterField = "tournament_id"
	// MatchListFilterName can be set to Filter on the name field
	MatchListFilterName MatchFilterField = "name"
	// MatchListFilterSlug can be set to Filter on the slug field
	MatchListFilterSlug MatchFilterField = "slug"
	// MatchListFilterDetailedStats can be set to Filter on the detailed_stats field
	MatchListFilterDetailedStats MatchFilterField = "detailed_stats"
	// MatchListFilterDraw can be set to Filter on the draw field
	MatchListFilterDraw MatchFilterField = "draw"
	// MatchListFilterFinished can be set to Filter on the finished field
	MatchListFilterFinished MatchFilterField = "finished"
	// MatchListFilterForfeit can be set to Filter on the forfeit field
	MatchListFilterForfeit MatchFilterField = "forfeit"
	// MatchListFilterFuture can be set to Filter on the future field
	MatchListFilterFuture MatchFilterField = "future"
	// MatchListFilterMatchType can be set to Filter on the match_type field
	MatchListFilterMatchType MatchFilterField = "match_type"
	// MatchListFilterNotStarted can be set to Filter on the not_started field
	MatchListFilterNotStarted MatchFilterField = "not_started"
	// MatchListFilterNumberOfGames can be set to Filter on the number_of_games field
	MatchListFilterNumberOfGames MatchFilterField = "number_of_games"
	// MatchListFilterOpponentID can be set to Filter on the opponent_id field
	MatchListFilterOpponentID MatchFilterField = "opponent_id"
	// MatchListFilterPast can be set to Filter on the past field
	MatchListFilterPast MatchFilterField = "past"
	// MatchListFilterRunning can be set to Filter on the running field
	MatchListFilterRunning MatchFilterField = "running"
	// MatchListFilterScheduledAt can be set to Filter on the scheduled_at field
	MatchListFilterScheduledAt MatchFilterField = "scheduled_at"
	// MatchListFilterStatus can be set to Filter on the status field
	MatchListFilterStatus MatchFilterField = "status"
	// MatchListFilterUnscheduled can be set to Filter on the unscheduled field
	MatchListFilterUnscheduled MatchFilterField = "unscheduled"
	// MatchListFilterVideoGame can be set to Filter on the videogame field
	MatchListFilterVideoGame MatchFilterField = "videogame"
	// MatchListFilterWinnerID can be set to Filter on the winner_id field
	MatchListFilterWinnerID MatchFilterField = "winner_id"
	// MatchListFilterBeginAt can be set to Filter on the begin_at field
	MatchListFilterBeginAt MatchFilterField = "begin_at"
	// MatchListFilterEndAt can be set to Filter on the end_at field
	MatchListFilterEndAt MatchFilterField = "end_at"
	// MatchListFilterModifiedAt can be set to Filter on the modified_at field
	MatchListFilterModifiedAt MatchFilterField = "modified_at"
)

type MatchListParams

type MatchListParams struct {
	VideoGame    VideoGameParam
	PageParams   *PageParams
	SortParams   []MatchSortField
	RangeParams  map[MatchRangeField]Range
	SearchParams map[MatchSearchField]string
	FilterParams map[MatchFilterField]string
}

MatchListParams contains all the possibilities usable to customize the query on listing the matches. All the fields are independant and optionnal.

func (*MatchListParams) StringifyParams

func (p *MatchListParams) StringifyParams() string

StringifyParams generates a string with all the parameters and/or default values to be then usable in the query url.

type MatchRangeField

type MatchRangeField string

MatchRangeField defines the values usable to range on matches.

const (
	// MatchRangeID can be set to range on id
	MatchRangeID MatchRangeField = "id"
	// MatchRangeName can be set to range on name
	MatchRangeName MatchRangeField = "name"
	// MatchRangeSlug can be set to range on slug
	MatchRangeSlug MatchRangeField = "slug"
	// MatchRangeWinnerID can be set to range on winner_id
	MatchRangeWinnerID MatchRangeField = "winner_id"
	// MatchRangeMatchID can be set to range on tournament_id
	MatchRangeTournamentID MatchRangeField = "tournament_id"
	// MatchRangePrizepool can be set to range on draw
	MatchRangeDraw MatchRangeField = "draw"
	// MatchRangeDetailedStats can be set to range on detailed_stats
	MatchRangeDetailedStats MatchRangeField = "detailed_stats"
	// MatchRangeForfeit can be set to range on forfeit
	MatchRangeForfeit MatchRangeField = "forfeit"
	// MatchRangeMatchType can be set to range on match_type
	MatchRangeMatchType MatchRangeField = "match_type"
	// MatchRangeNumberOfGames can be set to range on number_of_games
	MatchRangeNumberOfGames MatchRangeField = "number_of_games"
	// MatchRangeScheduledAt can be set to range on scheduled_at
	MatchRangeScheduledAt MatchRangeField = "scheduled_at"
	// MatchRangeStatus can be set to range on status
	MatchRangeStatus MatchRangeField = "status"
	// MatchRangeBeginAt can be set to range on begin_at
	MatchRangeBeginAt MatchRangeField = "begin_at"
	// MatchRangeEndAt can be set to range on end_at
	MatchRangeEndAt MatchRangeField = "end_at"
	// MatchRangeModifiedAt can be set to range on modified_at
	MatchRangeModifiedAt MatchRangeField = "modified_at"
)

type MatchSearchField

type MatchSearchField string

MatchSearchField defines the values usable to search on matches.

const (
	// MatchListSearchName can be set to search on the name field
	MatchListSearchName MatchSearchField = "name"
	// MatchListSearchSlug can be set to search on the slug field
	MatchListSearchSlug MatchSearchField = "slug"
	// MatchListSearchStatus can be set to search on the status field
	MatchListSearchStatus MatchSearchField = "status"
	// MatchListSearchMatchType can be set to search on the match_type field
	MatchListSearchMatchType MatchSearchField = "match_type"
)

type MatchSortField

type MatchSortField string

MatchSortField defines the values usable to sort on matches.

const (
	// MatchSortIDAsc can be set to sort per id asc order
	MatchSortIDAsc MatchSortField = "id"
	// MatchSortIDDesc can be set to sort per id desc order
	MatchSortIDDesc MatchSortField = "-id"
	// MatchSortModifiedAtAsc can be set to sort per modifed at value asc order
	MatchSortModifiedAtAsc MatchSortField = "modified_at"
	// MatchSortModifiedAtDesc can be set to sort per  modifed at value desc order
	MatchSortModifiedAtDesc MatchSortField = "-modified_at"
	// MatchSortNameAsc can be set to sort per name asc order
	MatchSortNameAsc MatchSortField = "name"
	// MatchSortNameDesc can be set to sort per name desc order
	MatchSortNameDesc MatchSortField = "-name"
	// MatchSortBeginAtAsc can be set to sort per begin_at asc order
	MatchSortBeginAtAsc MatchSortField = "begin_at"
	// MatchSortBeginAtDesc can be set to sort per begin_at desc order
	MatchSortBeginAtDesc MatchSortField = "-begin_at"
	// MatchSortEndAtAsc can be set to sort per end_at asc order
	MatchSortEndAtAsc MatchSortField = "end_at"
	// MatchSortEndAtDesc can be set to sort per end_at desc order
	MatchSortEndAtDesc MatchSortField = "-end_at"
	// MatchSortSlugAsc can be set to sort per slug asc order
	MatchSortSlugAsc MatchSortField = "slug"
	// MatchSortSlugDesc can be set to sort per slug desc order
	MatchSortSlugDesc MatchSortField = "-slug"
	// MatchSortWinnerIDAsc can be set to sort per winner_id asc order
	MatchSortWinnerIDAsc MatchSortField = "winner_id"
	// MatchSortWinnerIDDesc can be set to sort per winner_id desc order
	MatchSortWinnerIDDesc MatchSortField = "-winner_id"
	// MatchSortDetailedStatsAsc can be set to sort per detailed_stats asc order
	MatchSortDetailedStatsAsc MatchSortField = "detailed_stats"
	// MatchSortDetailedStatsDesc can be set to sort per detailed_stats desc order
	MatchSortDetailedStatsDesc MatchSortField = "-detailed_stats"
	// MatchSortDrawAsc can be set to sort per draw asc order
	MatchSortDrawAsc MatchSortField = "draw"
	// MatchSortDrawDesc can be set to sort per draw desc order
	MatchSortDrawDesc MatchSortField = "-draw"
	// MatchSortForfeitAsc can be set to sort per forfeit asc order
	MatchSortForfeitAsc MatchSortField = "forfeit"
	// MatchSortForfeitDesc can be set to sort per forfeit desc order
	MatchSortForfeitDesc MatchSortField = "-forfeit"
	// MatchSortMatchTypeAsc can be set to sort per match_type asc order
	MatchSortMatchTypeAsc MatchSortField = "match_type"
	// MatchSortMatchTypeDesc can be set to sort per match_type desc order
	MatchSortMatchTypeDesc MatchSortField = "-match_type"
	// MatchSortNumberOfGamesAsc can be set to sort per number_of_games asc order
	MatchSortNumberOfGamesAsc MatchSortField = "number_of_games"
	// MatchSortNumberOfGamesDesc can be set to sort per number_of_games desc order
	MatchSortNumberOfGamesDesc MatchSortField = "-number_of_games"
	// MatchSortScheduledAtAsc can be set to sort per scheduled_at asc order
	MatchSortScheduledAtAsc MatchSortField = "scheduled_at"
	// MatchSortScheduledAtDesc can be set to sort per scheduled_at desc order
	MatchSortScheduledAtDesc MatchSortField = "-scheduled_at"
	// MatchSortStatusAsc can be set to sort per status asc order
	MatchSortStatusAsc MatchSortField = "status"
	// MatchSortStatusDesc can be set to sort per status desc order
	MatchSortStatusDesc MatchSortField = "-status"
	// MatchSortMatchIDAsc can be set to sort per Match_id asc order
	MatchSortMatchIDAsc MatchSortField = "Match_id"
	// MatchSortMatchIDDesc can be set to sort per Match_id desc order
	MatchSortMatchIDDesc MatchSortField = "-Match_id"
)

type PageParams

type PageParams struct {
	PageSize   int `json:"page_size"`
	PageNumber int `json:"page_number"`
}

PageParams contains the values we can use to define the elements to return.

type Params

type Params interface {
	StringifyParams() string
}

Params is the interface allowing the backend to get parameters from all the resources as a single params struct.

type Player

type Player struct {
	ID          int    `json:"id"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	Nationality string `json:"nationality"`
	Role        string `json:"role"`
	HomeTown    string `json:"home_town"`
	ImageURL    string `json:"image_url"`
	CurrentTeam struct {
		ID         int       `json:"id"`
		Acronym    string    `json:"acronym"`
		Name       string    `json:"name"`
		Slug       string    `json:"slug"`
		ImageURL   string    `json:"image_url"`
		Location   string    `json:"location"`
		ModifiedAt time.Time `json:"modified_at"`
	} `json:"current_team"`
	CurrentVideoGame struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
		Slug string `json:"slug"`
	} `json:"current_videogame"`
	BirthYear int    `json:"birth_year"`
	BirthDay  string `json:"birthday"`
}

Player is the resource as defined in the PandaScore API. More details can be found here : https://developers.pandascore.co/doc/index.htm#operation/get_players

type PlayerFilterField

type PlayerFilterField string

PlayerFilterField defines the values usable to filter on Players.

const (
	// PlayerListFilterID can be set to Filter on the id field
	PlayerListFilterID PlayerFilterField = "id"
	// PlayerListFilterName can be set to Filter on the name field
	PlayerListFilterName PlayerFilterField = "name"
	// PlayerListFilterSlug can be set to Filter on the slug field
	PlayerListFilterSlug PlayerFilterField = "slug"
	// PlayerListFilterBirthYear can be set to Filter on the birth_year field
	PlayerListFilterBirthYear PlayerFilterField = "birth_year"
	// PlayerListFilterBirthDay can be set to Filter on the birthday field
	PlayerListFilterBirthDay PlayerFilterField = "birthday"
	// PlayerListFilterFirstName can be set to Filter on the first_name field
	PlayerListFilterFirstName PlayerFilterField = "first_name"
	// PlayerListFilterHometown can be set to Filter on the hometown field
	PlayerListFilterHometown PlayerFilterField = "hometown"
	// PlayerListFilterLastName can be set to Filter on the last_name field
	PlayerListFilterLastName PlayerFilterField = "last_name"
	// PlayerListFilterNationality can be set to Filter on the nationality field
	PlayerListFilterNationality PlayerFilterField = "nationality"
	// PlayerListFilterRole can be set to Filter on the role field
	PlayerListFilterRole PlayerFilterField = "role"
	// PlayerListFilterPlayerID can be set to Filter on the Player_id field
	PlayerListFilterPlayerID PlayerFilterField = "Player_id"
	// PlayerListFilterVideoGameID can be set to Filter on the videogame_id field
	PlayerListFilterVideoGameID PlayerFilterField = "videogame_id"
)

type PlayerListParams

type PlayerListParams struct {
	VideoGame    VideoGameParam
	PageParams   *PageParams
	SortParams   []PlayerSortField
	RangeParams  map[PlayerRangeField]Range
	SearchParams map[PlayerSearchField]string
	FilterParams map[PlayerFilterField]string
}

PlayerListParams contains all the possibilities usable to customize the query on listing the players. All the fields are independant and optionnal.

func (*PlayerListParams) StringifyParams

func (p *PlayerListParams) StringifyParams() string

StringifyParams generates a string with all the parameters and/or default values to be then usable in the query url.

type PlayerRangeField

type PlayerRangeField string

PlayerRangeField defines the values usable to range on players.

const (
	// PlayerRangeID can be set to range on id
	PlayerRangeID PlayerRangeField = "id"
	// PlayerRangeName can be set to range on name
	PlayerRangeName PlayerRangeField = "name"
	// PlayerRangeSlug can be set to range on slug
	PlayerRangeSlug PlayerRangeField = "slug"
	// PlayerRangeFirstName can be set to range on first_name
	PlayerRangeFirstName PlayerRangeField = "first_name"
	// PlayerRangeBirthDay can be set to range on birthday
	PlayerRangeBirthDay PlayerRangeField = "birthday"
	// PlayerRangeBirthYear can be set to range on first_name
	PlayerRangeBirthYear PlayerRangeField = "first_name"
	// PlayerRangeHomeTown can be set to range on hometown
	PlayerRangeHomeTown PlayerRangeField = "hometown"
	// PlayerRangeLastName can be set to range on last_name
	PlayerRangeLastName PlayerRangeField = "last_name"
	// PlayerRangeRole can be set to range on role
	PlayerRangeRole PlayerRangeField = "role"
	// PlayerRangeNationality can be set to range on nationality
	PlayerRangeNationality PlayerRangeField = "nationality"
)

type PlayerSearchField

type PlayerSearchField string

PlayerSearchField defines the values usable to search on players.

const (
	// PlayerListSearchName can be set to search on the name field
	PlayerListSearchName PlayerSearchField = "name"
	// PlayerListSearchSlug can be set to search on the slug field
	PlayerListSearchSlug PlayerSearchField = "slug"
	// PlayerListSearchBirthDay can be set to search on the birthday field
	PlayerListSearchBirthDay PlayerSearchField = "birthday"
	// PlayerListSearchFirstName can be set to search on the first_name field
	PlayerListSearchFirstName PlayerSearchField = "first_name"
	// PlayerListSearchHomeTown can be set to search on the hometown field
	PlayerListSearchHomeTown PlayerSearchField = "hometown"
	// PlayerListSearchLastName can be set to search on the last_name field
	PlayerListSearchLastName PlayerSearchField = "last_name"
	// PlayerListSearchNationality can be set to search on the nationality field
	PlayerListSearchNationality PlayerSearchField = "nationality"
	// PlayerListSearchRole can be set to search on the role field
	PlayerListSearchRole PlayerSearchField = "role"
)

type PlayerSortField

type PlayerSortField string

PlayerSortField defines the values usable to sort on players.

const (
	// PlayerSortIDAsc can be set to sort per id asc order
	PlayerSortIDAsc PlayerSortField = "id"
	// PlayerSortIDDesc can be set to sort per id desc order
	PlayerSortIDDesc PlayerSortField = "-id"
	// PlayerSortNameAsc can be set to sort per name asc order
	PlayerSortNameAsc PlayerSortField = "name"
	// PlayerSortNameDesc can be set to sort per name desc order
	PlayerSortNameDesc PlayerSortField = "-name"
	// PlayerSortSlugAsc can be set to sort per slug asc order
	PlayerSortSlugAsc PlayerSortField = "slug"
	// PlayerSortSlugDesc can be set to sort per slug desc order
	PlayerSortSlugDesc PlayerSortField = "-slug"
	// PlayerSortRoleAsc can be set to sort per role asc order
	PlayerSortRoleAsc PlayerSortField = "role"
	// PlayerSortRoleDesc can be set to sort per role desc order
	PlayerSortRoleDesc PlayerSortField = "-role"
	// PlayerSortFirstNameAsc can be set to sort per first_name asc order
	PlayerSortFirstNameAsc PlayerSortField = "first_name"
	// PlayerSortFirstNameDesc can be set to sort per first_name desc order
	PlayerSortFirstNameDesc PlayerSortField = "-first_name"
	// PlayerSortLastNameAsc can be set to sort per last_name asc order
	PlayerSortLastNameAsc PlayerSortField = "last_name"
	// PlayerSortLastNameDesc can be set to sort per last_name desc order
	PlayerSortLastNameDesc PlayerSortField = "-last_name"
	// PlayerSortBirthYearAsc can be set to sort per birth_year asc order
	PlayerSortBirthYearAsc PlayerSortField = "birth_year"
	// PlayerSortBirthYearDesc can be set to sort per birth_year desc order
	PlayerSortBirthYearDesc PlayerSortField = "-birth_year"
	// PlayerSortBirthDayAsc can be set to sort per birthday asc order
	PlayerSortBirthDayAsc PlayerSortField = "birthday"
	// PlayerSortBirthDayDesc can be set to sort per birthday desc order
	PlayerSortBirthDayDesc PlayerSortField = "-birthday"
	// PlayerSortHomeTownAsc can be set to sort per hometown asc order
	PlayerSortHomeTownAsc PlayerSortField = "hometown"
	// PlayerSortHomeTownDesc can be set to sort per hometown desc order
	PlayerSortHomeTownDesc PlayerSortField = "-hometown"
	// PlayerSortNationalityAsc can be set to sort per nationality asc order
	PlayerSortNationalityAsc PlayerSortField = "nationality"
	// PlayerSortNationalityDesc can be set to sort per nationality desc order
	PlayerSortNationalityDesc PlayerSortField = "-nationality"
	// PlayerSortTeamIDAsc can be set to sort per team_id asc order
	PlayerSortTeamIDAsc PlayerSortField = "team_id"
	// PlayerSortTeamIDDesc can be set to sort per team_id desc order
	PlayerSortTeamIDDesc PlayerSortField = "-team_id"
	// PlayerSortVideoGameIDAsc can be set to sort per videogame_id asc order
	PlayerSortVideoGameIDAsc PlayerSortField = "videogame_id"
	// PlayerSortVideoGameIDDesc can be set to sort per videogame_id desc order
	PlayerSortVideoGameIDDesc PlayerSortField = "-videogame_id"
)

type Range

type Range struct {
	Min interface{} `json:"min"`
	Max interface{} `json:"max"`
}

Range contains the min and max fields that should both be filled for the range to be usable.

type Serie

type Serie struct {
	ID          int    `json:"id"`
	LeagueID    int    `json:"league_id"`
	FullName    string `json:"full_name"`
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	Description string `json:"description"`
	Season      string `json:"season"`
	Tier        string `json:"tier"`
	Year        int    `json:"year"`
	WinnerID    int    `json:"winner_id"`
	WinnerType  string `json:"winner_type"`
	League      struct {
		ID         int       `json:"id"`
		Name       string    `json:"name"`
		Slug       string    `json:"slug"`
		URL        string    `json:"url"`
		ImageURL   string    `json:"image_url"`
		ModifiedAt time.Time `json:"modified_at"`
	} `json:"league"`
	VideoGame struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
		Slug string `json:"slug"`
	} `json:"videogame"`
	VideoGameTitle struct {
		ID          int    `json:"id"`
		VideoGameID int    `json:"videogame_id"`
		Name        string `json:"name"`
	} `json:"videogame_title"`
	Tournaments []struct {
		ID            int       `json:"id"`
		LeagueID      int       `json:"league_id"`
		SerieID       int       `json:"serie_id"`
		Name          string    `json:"name"`
		Slug          string    `json:"slug"`
		LiveSupported bool      `json:"live_supported"`
		PrizePool     string    `json:"prizepool"`
		WinnerID      int       `json:"winner_id"`
		WinnerType    string    `json:"winner_type"`
		BeginAt       time.Time `json:"begin_at"`
		EndAt         time.Time `json:"end_at"`
		ModifiedAt    time.Time `json:"modified_at"`
	} `json:"tournaments"`

	BeginAt    time.Time `json:"begin_at"`
	EndAt      time.Time `json:"end_at"`
	ModifiedAt time.Time `json:"modified_at"`
}

Serie is the resource as defined in the PandaScore API. More details can be found here : https://developers.pandascore.co/doc/index.htm#operation/get_series

type SerieFilterField

type SerieFilterField string

SerieFilterField defines the values usable to filter on series.

const (
	// SerieListFilterID can be set to Filter on the id field
	SerieListFilterID SerieFilterField = "id"
	// SerieListFilterLeagueID can be set to Filter on the league_id field
	SerieListFilterLeagueID SerieFilterField = "league_id"
	// SerieListFilterName can be set to Filter on the name field
	SerieListFilterName SerieFilterField = "name"
	// SerieListFilterSlug can be set to Filter on the slug field
	SerieListFilterSlug SerieFilterField = "slug"
	// SerieListFilterDescription can be set to Filter on the description field
	SerieListFilterDescription SerieFilterField = "description"
	// SerieListFilterSeason can be set to Filter on the season field
	SerieListFilterSeason SerieFilterField = "season"
	// SerieListFilterTier can be set to Filter on the tier field
	SerieListFilterTier SerieFilterField = "tier"
	// SerieListFilterYear can be set to Filter on the year field
	SerieListFilterYear SerieFilterField = "year"
	// SerieListFilterWinnerID can be set to Filter on the winner_id field
	SerieListFilterWinnerID SerieFilterField = "winner_id"
	// SerieListFilterWinnerType can be set to Filter on the winner_type field
	SerieListFilterWinnerType SerieFilterField = "winner_type"
	// SerieListFilterBeginAt can be set to Filter on the begin_at field
	SerieListFilterBeginAt SerieFilterField = "begin_at"
	// SerieListFilterEndAt can be set to Filter on the end_at field
	SerieListFilterEndAt SerieFilterField = "end_at"
	// SerieListFilterModifiedAt can be set to Filter on the modified_at field
	SerieListFilterModifiedAt SerieFilterField = "modified_at"
)

type SerieListParams

type SerieListParams struct {
	VideoGame    VideoGameParam
	PageParams   *PageParams
	SortParams   []SerieSortField
	RangeParams  map[SerieRangeField]Range
	SearchParams map[SerieSearchField]string
	FilterParams map[SerieFilterField]string
}

SerieListParams contains all the possibilities usable to customize the query on listing the series. All the fields are independant and optionnal.

func (*SerieListParams) StringifyParams

func (p *SerieListParams) StringifyParams() string

StringifyParams generates a string with all the parameters and/or default values to be then usable in the query url.

type SerieRangeField

type SerieRangeField string

SerieRangeField defines the values usable to range on series.

const (
	// SerieRangeID can be set to range on id
	SerieRangeID SerieRangeField = "id"
	// SerieRangeLeagueID can be set to range on league_id
	SerieRangeLeagueID SerieRangeField = "league_id"
	// SerieRangeModifiedAt can be set to range on modified_at
	SerieRangeModifiedAt SerieRangeField = "modified_at"
	// SerieRangeName can be set to range on name
	SerieRangeName SerieRangeField = "name"
	// SerieRangeDescription can be set to range on description
	SerieRangeDescription SerieRangeField = "description"
	// SerieRangeSlug can be set to range on slug
	SerieRangeSlug SerieRangeField = "slug"
	// SerieRangeBeginAt can be set to range on begin_at
	SerieRangeBeginAt SerieRangeField = "begin_at"
	// SerieRangeEndAt can be set to range on end_at
	SerieRangeEndAt SerieRangeField = "end_at"
	// SerieRangeSeason can be set to range on season
	SerieRangeSeason SerieRangeField = "season"
	// SerieRangeTier can be set to range on tier
	SerieRangeTier SerieRangeField = "tier"
	// SerieRangeWinnerID can be set to range on winner_id
	SerieRangeWinnerID SerieRangeField = "winner_id"
	// SerieRangeWinnerType can be set to range on winner type
	SerieRangeWinnerType SerieRangeField = "winner_type"
)

type SerieSearchField

type SerieSearchField string

SerieSearchField defines the values usable to search on series.

const (
	// SerieListSearchName can be set to search on the name field
	SerieListSearchName SerieSearchField = "name"
	// SerieListSearchDescription can be set to search on the description field
	SerieListSearchDescription SerieSearchField = "description"
	// SerieListSearchSeason can be set to search on the season field
	SerieListSearchSeason SerieSearchField = "season"
	// SerieListSearchSlug can be set to search on the slug field
	SerieListSearchSlug SerieSearchField = "slug"
	// SerieListSearchTier can be set to search on the tier field
	SerieListSearchTier SerieSearchField = "tier"
	// SerieListSearchWinnerType can be set to search on the winner_type field
	SerieListSearchWinnerType SerieSearchField = "winner_type"
)

type SerieSortField

type SerieSortField string

SerieSortField defines the values usable to sort on series.

const (
	// SerieSortIDAsc can be set to sort per id asc order
	SerieSortIDAsc SerieSortField = "id"
	// SerieSortIDDesc can be set to sort per id desc order
	SerieSortIDDesc SerieSortField = "-id"
	// SerieSortModifiedAtAsc can be set to sort per modifed at value asc order
	SerieSortModifiedAtAsc SerieSortField = "modified_at"
	// SerieSortModifiedAtDesc can be set to sort per  modifed at value desc order
	SerieSortModifiedAtDesc SerieSortField = "-modified_at"
	// SerieSortNameAsc can be set to sort per name asc order
	SerieSortNameAsc SerieSortField = "name"
	// SerieSortNameDesc can be set to sort per name desc order
	SerieSortNameDesc SerieSortField = "-name"
	// SerieSortSlugAsc can be set to sort per slug asc order
	SerieSortSlugAsc SerieSortField = "slug"
	// SerieSortSlugDesc can be set to sort per slug desc order
	SerieSortSlugDesc SerieSortField = "-slug"
	// SerieSortBeginAtAsc can be set to sort per begin_at asc order
	SerieSortBeginAtAsc SerieSortField = "begin_at"
	// SerieSortBeginAtDesc can be set to sort per begin_at desc order
	SerieSortBeginAtDesc SerieSortField = "-begin_at"
	// SerieSortDescriptionAsc can be set to sort per description asc order
	SerieSortDescriptionAsc SerieSortField = "description"
	// SerieSortDescriptionDesc can be set to sort per description desc order
	SerieSortDescriptionDesc SerieSortField = "-description"
	// SerieSortEndAtAsc can be set to sort per end_at asc order
	SerieSortEndAtAsc SerieSortField = "end_at"
	// SerieSortEndAtDesc can be set to sort per end_at desc order
	SerieSortEndAtDesc SerieSortField = "-end_at"
	// SerieSortLeagueIDAsc can be set to sort per league_id asc order
	SerieSortLeagueIDAsc SerieSortField = "league_id"
	// SerieSortLeagueIDDesc can be set to sort per league_id desc order
	SerieSortLeagueIDDesc SerieSortField = "-league_id"
	// SerieSortSeasonAsc can be set to sort per season asc order
	SerieSortSeasonAsc SerieSortField = "season"
	// SerieSortSeasonDesc can be set to sort per season desc order
	SerieSortSeasonDesc SerieSortField = "-season"
	// SerieSortTierAsc can be set to sort per tier asc order
	SerieSortTierAsc SerieSortField = "tier"
	// SerieSortTierDesc can be set to sort per tier desc order
	SerieSortTierDesc SerieSortField = "-tier"
	// SerieSortWinnerIDAsc can be set to sort per winner_id asc order
	SerieSortWinnerIDAsc SerieSortField = "winner_id"
	// SerieSortWinnerIDDesc can be set to sort per winner_id desc order
	SerieSortWinnerIDDesc SerieSortField = "-winner_id"
	// SerieSortWinnerTypeAsc can be set to sort per winner_type asc order
	SerieSortWinnerTypeAsc SerieSortField = "winner_type"
	// SerieSortWinnerTypeDesc can be set to sort per winner_type desc order
	SerieSortWinnerTypeDesc SerieSortField = "-winner_type"
	// SerieSortYearAsc can be set to sort per year asc order
	SerieSortYearAsc SerieSortField = "year"
	// SerieSortYearDesc can be set to sort per year desc order
	SerieSortYearDesc SerieSortField = "-year"
)

type Team

type Team struct {
	ID       int    `json:"id"`
	Acronym  string `json:"acronym"`
	Name     string `json:"name"`
	Slug     string `json:"slug"`
	ImageURL string `json:"image_url"`
	Location string `json:"location"`
	Players  struct {
		ID          int    `json:"id"`
		FirstName   string `json:"first_name"`
		LastName    string `json:"last_name"`
		Name        string `json:"name"`
		Slug        string `json:"slug"`
		ImageURL    string `json:"image_url"`
		Nationality string `json:"nationality"`
		Role        string `json:"role"`
		HomeTown    string `json:"home_town"`
		BirthYear   int    `json:"birth_year"`
		BirthDay    string `json:"birthday"`
	} `json:"players"`
	CurrentVideoGame struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
		Slug string `json:"slug"`
	} `json:"current_videogame"`
	ModifiedAt time.Time `json:"modified_at"`
}

Team is the resource as defined in the PandaScore API. More details can be found here : https://developers.pandascore.co/doc/index.htm#operation/get_teams

type TeamFilterField

type TeamFilterField string

TeamFilterField defines the values usable to filter on teams.

const (
	// TeamListFilterID can be set to Filter on the id field
	TeamListFilterID TeamFilterField = "id"
	// TeamListFilterName can be set to Filter on the name field
	TeamListFilterName TeamFilterField = "name"
	// TeamListFilterSlug can be set to Filter on the slug field
	TeamListFilterSlug TeamFilterField = "slug"
	// TeamListFilterAcronym can be set to Filter on the acronym field
	TeamListFilterAcronym TeamFilterField = "acronym"
	// TeamListFilterLocation can be set to Filter on the location field
	TeamListFilterLocation TeamFilterField = "location"
	// TeamListFilterVideoGameID can be set to Filter on the videogame_id field
	TeamListFilterVideoGameID TeamFilterField = "videogame_id"
	// TeamListFilterModifiedAt can be set to Filter on the modified_at field
	TeamListFilterModifiedAt TeamFilterField = "modified_at"
)

type TeamListParams

type TeamListParams struct {
	VideoGame    VideoGameParam
	PageParams   *PageParams
	SortParams   []TeamSortField
	RangeParams  map[TeamRangeField]Range
	SearchParams map[TeamSearchField]string
	FilterParams map[TeamFilterField]string
}

TeamListParams contains all the possibilities usable to customize the query on listing the teams. All the fields are independant and optionnal.

func (*TeamListParams) StringifyParams

func (p *TeamListParams) StringifyParams() string

StringifyParams generates a string with all the parameters and/or default values to be then usable in the query url.

type TeamRangeField

type TeamRangeField string

TeamRangeField defines the values usable to range on teams.

const (
	// TeamRangeID can be set to range on id
	TeamRangeID TeamRangeField = "id"
	// TeamRangeName can be set to range on name
	TeamRangeName TeamRangeField = "name"
	// TeamRangeSlug can be set to range on slug
	TeamRangeSlug TeamRangeField = "slug"
	// TeamRangeAcronym can be set to range on acronym
	TeamRangeAcronym TeamRangeField = "acronym"
	// TeamRangeLocation can be set to range on location
	TeamRangeLocation TeamRangeField = "location"
	// TeamRangeModifiedAt can be set to range on modified_at
	TeamRangeModifiedAt TeamRangeField = "modified_at"
)

type TeamSearchField

type TeamSearchField string

TeamSearchField defines the values usable to search on teams.

const (
	// TeamListSearchName can be set to search on the name field
	TeamListSearchName TeamSearchField = "name"
	// TeamListSearchSlug can be set to search on the slug field
	TeamListSearchSlug TeamSearchField = "slug"
	// TeamListSearchAcronym can be set to search on the acronym field
	TeamListSearchAcronym TeamSearchField = "acronym"
	// TeamListSearchLocation can be set to search on the location field
	TeamListSearchLocation TeamSearchField = "location"
)

type TeamSortField

type TeamSortField string

TeamSortField defines the values usable to sort on teams.

const (
	// TeamSortIDAsc can be set to sort per id asc order
	TeamSortIDAsc TeamSortField = "id"
	// TeamSortIDDesc can be set to sort per id desc order
	TeamSortIDDesc TeamSortField = "-id"
	// TeamSortNameAsc can be set to sort per name asc order
	TeamSortNameAsc TeamSortField = "name"
	// TeamSortNameDesc can be set to sort per name desc order
	TeamSortNameDesc TeamSortField = "-name"
	// TeamSortAcronymAsc can be set to sort per acronym asc order
	TeamSortAcronymAsc TeamSortField = "acronym"
	// TeamSortAcronymDesc can be set to sort per acronym desc order
	TeamSortAcronymDesc TeamSortField = "-acronym"
	// TeamSortSlugAsc can be set to sort per slug asc order
	TeamSortSlugAsc TeamSortField = "slug"
	// TeamSortSlugDesc can be set to sort per slug desc order
	TeamSortSlugDesc TeamSortField = "-slug"
	// TeamSortLocationAsc can be set to sort per location asc order
	TeamSortLocationAsc TeamSortField = "location"
	// TeamSortLocationDesc can be set to sort per location desc order
	TeamSortLocationDesc TeamSortField = "-location"
	// TeamSortVideoGameIDAsc can be set to sort per videogame_id asc order
	TeamSortVideoGameIDAsc TeamSortField = "videogame_id"
	// TeamSortVideoGameIDDesc can be set to sort per videogame_id desc order
	TeamSortVideoGameIDDesc TeamSortField = "-videogame_id"
	// TeamSortModifiedAtAsc can be set to sort per modifed at value asc order
	TeamSortModifiedAtAsc TeamSortField = "modified_at"
	// TeamSortModifiedAtDesc can be set to sort per  modifed at value desc order
	TeamSortModifiedAtDesc TeamSortField = "-modified_at"
)

type Tournament

type Tournament struct {
	ID            int    `json:"id"`
	LeagueID      int    `json:"league_id"`
	SerieID       int    `json:"serie_id"`
	Name          string `json:"name"`
	Slug          string `json:"slug"`
	LiveSupported bool   `json:"live_supported"`
	PrizePool     string `json:"prizepool"`
	WinnerID      int    `json:"winner_id"`
	WinnerType    string `json:"winner_type"`
	League        struct {
		ID         int       `json:"id"`
		Name       string    `json:"name"`
		Slug       string    `json:"slug"`
		URL        string    `json:"url"`
		ImageURL   string    `json:"image_url"`
		ModifiedAt time.Time `json:"modified_at"`
	} `json:"league"`
	Serie struct {
		ID          int       `json:"id"`
		LeagueID    int       `json:"league_id"`
		FullName    string    `json:"full_name"`
		Name        string    `json:"name"`
		Slug        string    `json:"slug"`
		Description string    `json:"description"`
		Season      string    `json:"string"`
		Tier        string    `json:"tier"`
		WinnerID    int       `json:"winner_id"`
		WinnerType  string    `json:"winner_type"`
		Year        int       `json:"year"`
		BeginAt     time.Time `json:"begin_at"`
		EndAt       time.Time `json:"end_at"`
		ModifiedAt  time.Time `json:"modified_at"`
	} `json:"serie"`
	Matches []struct {
		ID            int    `json:"id"`
		TournamentID  int    `json:"tournament_id"`
		Name          string `json:"name"`
		Slug          string `json:"slug"`
		Status        string `json:"status"` // in "canceled" "finished" "not_started" "postponed" "running"
		Draw          bool   `json:"draw"`
		Forfeit       bool   `json:"forfeit"`
		GameAdvantage int    `json:"game_advantage"`
		DetailedStats bool   `json:"detailed_stats"`
		Live          struct {
			OpensAt   string `json:"opens_at"`
			Supported bool   `json:"supported"`
			URL       string `json:"url"`
		} `json:"live"`
		MatchType     string `json:"match_type"` // in  "best_of" "custom" "first_to" "ow_best_of"
		NumberOfGames int    `json:"number_of_games"`
		WinnerID      int    `json:"winner_id"`
		Streams       struct {
			English struct {
				EmbedURL string `json:"embed_url"`
				RawURL   string `json:"raw_url"`
			} `json:"english"`
			Original struct {
				EmbedURL string `json:"embed_url"`
				RawURL   string `json:"raw_url"`
			} `json:"original"`
			Russian struct {
				EmbedURL string `json:"embed_url"`
				RawURL   string `json:"raw_url"`
			} `json:"russian"`
		} `json:"streams"`
		Rescheduled         bool      `json:"rescheduled"`
		ScheduledAt         time.Time `json:"scheduled_at"`
		OriginalScheduledAt time.Time `json:"original_scheduled_at"`
		BeginAt             time.Time `json:"begin_at"`
		EndAt               time.Time `json:"end_at"`
		ModifiedAt          time.Time `json:"modified_at"`
	} `json:"matches"`
	Teams []struct {
		ID         int       `json:"id"`
		Acronym    string    `json:"acronym"`
		Name       string    `json:"name"`
		Slug       string    `json:"slug"`
		ImageURL   string    `json:"image_url"`
		Location   string    `json:"location"`
		ModifiedAt time.Time `json:"modified_at"`
	} `json:"teams"`
	VideoGame struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
		Slug string `json:"slug"`
	} `json:"videogame"`
	BeginAt    time.Time `json:"begin_at"`
	EndAt      time.Time `json:"end_at"`
	ModifiedAt time.Time `json:"modified_at"`
}

Tournament is the resource as defined in the PandaScore API. More details can be found here : https://developers.pandascore.co/doc/index.htm#operation/get_tournaments

type TournamentFilterField

type TournamentFilterField string

TournamentFilterField defines the values usable to filter on tournaments.

const (
	// TournamentListFilterID can be set to Filter on the id field
	TournamentListFilterID TournamentFilterField = "id"
	// TournamentListFilterSerieID can be set to Filter on the serie_id field
	TournamentListFilterSerieID TournamentFilterField = "serie_id"
	// TournamentListFilterName can be set to Filter on the name field
	TournamentListFilterName TournamentFilterField = "name"
	// TournamentListFilterSlug can be set to Filter on the slug field
	TournamentListFilterSlug TournamentFilterField = "slug"

	// TournamentListFilterLiveSupported can be set to Filter on the live_supported field
	TournamentListFilterLiveSupported TournamentFilterField = "live_supported"
	// TournamentListFilterPrizepool can be set to Filter on the prizepool field
	TournamentListFilterPrizepool TournamentFilterField = "prizepool"

	// TournamentListFilterWinnerID can be set to Filter on the winner_id field
	TournamentListFilterWinnerID TournamentFilterField = "winner_id"
	// TournamentListFilterWinnerType can be set to Filter on the winner_type field
	TournamentListFilterWinnerType TournamentFilterField = "winner_type"
	// TournamentListFilterBeginAt can be set to Filter on the begin_at field
	TournamentListFilterBeginAt TournamentFilterField = "begin_at"
	// TournamentListFilterEndAt can be set to Filter on the end_at field
	TournamentListFilterEndAt TournamentFilterField = "end_at"
	// TournamentListFilterModifiedAt can be set to Filter on the modified_at field
	TournamentListFilterModifiedAt TournamentFilterField = "modified_at"
)

type TournamentListParams

type TournamentListParams struct {
	VideoGame    VideoGameParam
	PageParams   *PageParams
	SortParams   []TournamentSortField
	RangeParams  map[TournamentRangeField]Range
	SearchParams map[TournamentSearchField]string
	FilterParams map[TournamentFilterField]string
}

TournamentListParams contains all the possibilities usable to customize the query on listing the tournaments. All the fields are independant and optionnal.

func (*TournamentListParams) StringifyParams

func (p *TournamentListParams) StringifyParams() string

StringifyParams generates a string with all the parameters and/or default values to be then usable in the query url.

type TournamentRangeField

type TournamentRangeField string

TournamentRangeField defines the values usable to range on tournaments.

const (
	// TournamentRangeID can be set to range on id
	TournamentRangeID TournamentRangeField = "id"
	// TournamentRangeSerieID can be set to range on serie_id
	TournamentRangeSerieID TournamentRangeField = "serie_id"
	// TournamentRangeName can be set to range on name
	TournamentRangeName TournamentRangeField = "name"
	// TournamentRangePrizepool can be set to range on prizepool
	TournamentRangePrizepool TournamentRangeField = "prizepool"
	// TournamentRangeSlug can be set to range on slug
	TournamentRangeSlug TournamentRangeField = "slug"
	// TournamentRangeWinnerID can be set to range on winner_id
	TournamentRangeWinnerID TournamentRangeField = "winner_id"
	// TournamentRangeWinnerType can be set to range on winner_type
	TournamentRangeWinnerType TournamentRangeField = "winner_type"
	// TournamentRangeBeginAt can be set to range on begin_at
	TournamentRangeBeginAt TournamentRangeField = "begin_at"
	// TournamentRangeEndAt can be set to range on end_at
	TournamentRangeEndAt TournamentRangeField = "end_at"
	// TournamentRangeModifiedAt can be set to range on modified_at
	TournamentRangeModifiedAt TournamentRangeField = "modified_at"
)

type TournamentSearchField

type TournamentSearchField string

TournamentSearchField defines the values usable to search on tournaments.

const (
	// TournamentListSearchName can be set to search on the name field
	TournamentListSearchName TournamentSearchField = "name"
	// TournamentListSearchSlug can be set to search on the slug field
	TournamentListSearchSlug TournamentSearchField = "slug"
	// TournamentListSearchPrizepool can be set to search on the prizepool field
	TournamentListSearchPrizepool TournamentSearchField = "prizepool"
	// TournamentListSearchWinnerType can be set to search on the winner_type field
	TournamentListSearchWinnerType TournamentSearchField = "winner_type"
)

type TournamentSortField

type TournamentSortField string

TournamentSortField defines the values usable to sort on tournaments.

const (
	// TournamentSortIDAsc can be set to sort per id asc order
	TournamentSortIDAsc TournamentSortField = "id"
	// TournamentSortIDDesc can be set to sort per id desc order
	TournamentSortIDDesc TournamentSortField = "-id"
	// TournamentSortSerieIDAsc can be set to sort per serie_id asc order
	TournamentSortSerieIDAsc TournamentSortField = "serie_id"
	// TournamentSortSerieIDDesc can be set to sort per serie_id desc order
	TournamentSortSerieIDDesc TournamentSortField = "-serie_id"
	// TournamentSortModifiedAtAsc can be set to sort per modifed at value asc order
	TournamentSortModifiedAtAsc TournamentSortField = "modified_at"
	// TournamentSortModifiedAtDesc can be set to sort per  modifed at value desc order
	TournamentSortModifiedAtDesc TournamentSortField = "-modified_at"
	// TournamentSortNameAsc can be set to sort per name asc order
	TournamentSortNameAsc TournamentSortField = "name"
	// TournamentSortNameDesc can be set to sort per name desc order
	TournamentSortNameDesc TournamentSortField = "-name"
	// TournamentSortSlugAsc can be set to sort per slug asc order
	TournamentSortSlugAsc TournamentSortField = "slug"
	// TournamentSortSlugDesc can be set to sort per slug desc order
	TournamentSortSlugDesc TournamentSortField = "-slug"
	// TournamentSortBeginAtAsc can be set to sort per begin_at asc order
	TournamentSortBeginAtAsc TournamentSortField = "begin_at"
	// TournamentSortBeginAtDesc can be set to sort per begin_at desc order
	TournamentSortBeginAtDesc TournamentSortField = "-begin_at"
	// TournamentSortEndAtAsc can be set to sort per end_at asc order
	TournamentSortEndAtAsc TournamentSortField = "end_at"
	// TournamentSortEndAtDesc can be set to sort per end_at desc order
	TournamentSortEndAtDesc TournamentSortField = "-end_at"
	// TournamentSortWinnerIDAsc can be set to sort per winner_id asc order
	TournamentSortWinnerIDAsc TournamentSortField = "winner_id"
	// TournamentSortWinnerIDDesc can be set to sort per winner_id desc order
	TournamentSortWinnerIDDesc TournamentSortField = "-winner_id"
	// TournamentSortWinnerTypeAsc can be set to sort per winner_type asc order
	TournamentSortWinnerTypeAsc TournamentSortField = "winner_type"
	// TournamentSortWinnerTypeDesc can be set to sort per winner_type desc order
	TournamentSortWinnerTypeDesc TournamentSortField = "-winner_type"
	// TournamentSortPrizepoolAsc can be set to sort per prizepool asc order
	TournamentSortPrizepoolAsc TournamentSortField = "prizepool"
	// TournamentSortPrizepoolDesc can be set to sort per prizepool desc order
	TournamentSortPrizepoolDesc TournamentSortField = "-prizepool"
)

type VideoGameParam

type VideoGameParam int
const (
	VideoGameAll VideoGameParam = iota
	VideoGameCSGO
	VideoGameLOL
	VideoGameOverwatch
	VideoGameCOD
	VideoGameDOTA
	VideoGameFIFA
	VideoGamePUBG
	VideoGameR6
	VideoGameRL
)

func GetVideoGameFromSlug

func GetVideoGameFromSlug(slug string) VideoGameParam

func (VideoGameParam) GetSlug

func (p VideoGameParam) GetSlug() string

func (VideoGameParam) GetURLPath

func (p VideoGameParam) GetURLPath() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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