Documentation ¶
Index ¶
- func ErrToBytes(obj interface{}) (int, []byte, error)
- func IsStatusCodeError(target error) bool
- func ToBytes(obj interface{}) ([]byte, error)
- type AdvancedSuggestsInterface
- type CoacheSuggests
- type CompetitionMatches
- type CompetitionSuggests
- type CompetitionWeeks
- type CompetitionsList
- type MatchBase
- type MatchInfo
- type PlayerSuggests
- type RequestConfig
- type Session
- func (cli *Session) AdvancedSearch(q string, filter uint8, offset, limit uint16) (AdvancedSuggestsInterface, error)
- func (cli *Session) GetCompetitionStandingTable(current_id string) (StandingTable, error)
- func (cli *Session) GetCompetitionWeeks(current_id string) (*CompetitionWeeks, error)
- func (cli *Session) GetCompetitionsList(c_type string) (CompetitionsList, error)
- func (cli *Session) GetMatchInfo(match_id string) (*MatchInfo, error)
- func (cli *Session) GetMatchesByDate(days int, slugs ...string) (CompetitionMatches, error)
- func (cli *Session) GetMatchesByWeekNumber(current_id string, week_number uint32) ([]MatchBase, error)
- func (cli *Session) GetTransfers(season_id string) (Transfers, error)
- func (cli *Session) GetTransfersRegions() (*TransfersRegions, error)
- func (s *Session) Request(r RequestConfig, f func(*fasthttp.Response) error) error
- func (s *Session) RequestJSON(req RequestConfig, obj interface{}) error
- func (cli *Session) Search(q string, s_type uint8) (*Suggests, error)
- type Stadium
- type StandingTable
- type StatusCodeError
- type Suggests
- type Team
- type TeamSuggests
- type Transfers
- type TransfersRegions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrToBytes ¶
func IsStatusCodeError ¶
Types ¶
type CoacheSuggests ¶
type CoacheSuggests struct { Count int `json:"count"` Results []struct { ID string `json:"id"` Fullname string `json:"fullname"` Person struct { // Fullname string `json:"fullname"` // ID string `json:"id"` Image string `json:"image"` } `json:"person"` } `json:"results"` // contains filtered or unexported fields }
func (CoacheSuggests) HasMore ¶
func (s CoacheSuggests) HasMore() bool
func (CoacheSuggests) Limit ¶
func (s CoacheSuggests) Limit() uint16
func (CoacheSuggests) Offset ¶
func (s CoacheSuggests) Offset() uint16
type CompetitionMatches ¶
type CompetitionSuggests ¶
type CompetitionSuggests struct { Count int `json:"count"` Results []struct { ID string `json:"id"` Title string `json:"title"` Slug string `json:"slug"` Logo string `json:"logo"` Thumbnail string `json:"thumbnail"` SeoSlug string `json:"seo_slug"` } `json:"results"` // contains filtered or unexported fields }
func (CompetitionSuggests) HasMore ¶
func (s CompetitionSuggests) HasMore() bool
func (CompetitionSuggests) Limit ¶
func (s CompetitionSuggests) Limit() uint16
func (CompetitionSuggests) Offset ¶
func (s CompetitionSuggests) Offset() uint16
type CompetitionWeeks ¶
type CompetitionWeeks struct { ID string `json:"id"` Competition string `json:"competition"` // StartTime interface{} `json:"start_time"` // SeoSlug string `json:"seo_slug"` Slug string `json:"slug"` // EndTime int `json:"end_time"` CurrentWeek struct { WeekNumber uint32 `json:"week_number"` } `json:"current_week"` Weeks []struct { WeekNumber uint32 `json:"week_number"` } `json:"weeks"` }
type CompetitionsList ¶
type CompetitionsList []struct { ID string `json:"id"` Title string `json:"title"` Status string `json:"status"` Type string `json:"type"` Current struct { ID string `json:"id"` Title string `json:"title"` Slug string `json:"slug"` Logo string `json:"logo"` // Thumbnail string `json:"thumbnail"` SeoSlug string `json:"seo_slug"` } `json:"current"` }
type MatchBase ¶
type MatchBase struct { ID string `json:"id"` HomeTeam *Team `json:"home_team"` AwayTeam *Team `json:"away_team"` HomeScore int `json:"home_score"` AwayScore int `json:"away_score"` StatusDetails struct { StatusID int `json:"status_id"` Title string `json:"title"` StatusType string `json:"status_type"` } `json:"status_details"` HoldsAt int `json:"holds_at"` StartedAt int `json:"started_at"` // IsActive bool `json:"is_active"` // IsPostponed bool `json:"is_postponed"` BroadcastChannel string `json:"broadcast_channel"` IsFinished bool `json:"is_finished"` Competition struct { ID string `json:"id"` Title string `json:"title"` } `json:"competition"` WeekNumber int `json:"week_number"` Minute int `json:"minute"` // Slug string `json:"slug"` Stadium *Stadium `json:"stadium"` HomePenaltyScore int `json:"home_penalty_score"` AwayPenaltyScore int `json:"away_penalty_score"` // Spectators int `json:"spectators"` HasStanding bool `json:"has_standing"` // HasStats bool `json:"has_stats"` // HasLineups bool `json:"has_lineups"` CompetitionTrendStageID string `json:"competition_trend_stage_id"` }
type MatchInfo ¶
type MatchInfo struct { ID string `json:"id"` HomeTeam *Team `json:"home_team"` AwayTeam *Team `json:"away_team"` HomeScore int `json:"home_score"` AwayScore int `json:"away_score"` HoldsAt int `json:"holds_at"` // IsPostponed bool `json:"is_postponed"` IsFinished bool `json:"is_finished"` Status struct { StatusID int `json:"status_id"` Title string `json:"title"` StatusType string `json:"status_type"` } `json:"status"` Minute int `json:"minute"` HomePenaltyScore int `json:"home_penalty_score"` AwayPenaltyScore int `json:"away_penalty_score"` ToBeDecided bool `json:"to_be_decided"` BroadcastChannel string `json:"broadcast_channel"` CompetitionTrendStage struct { ID string `json:"id"` Name string `json:"name"` } `json:"competition_trend_stage"` CompetitionTrend struct { ID string `json:"id"` Title string `json:"title"` Slug string `json:"slug"` } `json:"competition_trend"` Stadium *Stadium `json:"stadium"` HeaderEvents []struct { ID string `json:"id"` Player struct { ID string `json:"id"` // Slug string `json:"slug"` Fullname string `json:"fullname"` // Image string `json:"image"` // Position struct { // Key string `json:"key"` // Value string `json:"value"` // } `json:"position"` KitNumber int `json:"kit_number"` } `json:"player"` Team *Team `json:"team"` EventType struct { ShortForm string `json:"short_form"` Title string `json:"title"` } `json:"event_type"` Minute int `json:"minute"` MinutePlus int `json:"minute_plus"` } `json:"header_events"` }
type PlayerSuggests ¶
type PlayerSuggests struct { Count int `json:"count"` Results []struct { ID string `json:"id"` // Slug string `json:"slug"` Fullname string `json:"fullname"` Image string `json:"image"` // Position struct { // Key string `json:"key"` // Value string `json:"value"` // } `json:"position"` KitNumber int `json:"kit_number"` } `json:"results"` // contains filtered or unexported fields }
func (PlayerSuggests) HasMore ¶
func (s PlayerSuggests) HasMore() bool
func (PlayerSuggests) Limit ¶
func (s PlayerSuggests) Limit() uint16
func (PlayerSuggests) Offset ¶
func (s PlayerSuggests) Offset() uint16
type RequestConfig ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(logger *logging.FileLogger, readTimeout, writeTimeout time.Duration) *Session
func (*Session) AdvancedSearch ¶
func (cli *Session) AdvancedSearch(q string, filter uint8, offset, limit uint16) (AdvancedSuggestsInterface, error)
Searches with result filtering
Parameters:
- q: Query ( assert len(q) > 3 )
- filter: Search for what? teams:0, players:1, coaches:2, or competitions:3
- offset: result offset
- limit: result limit ( default 10 )
func (*Session) GetCompetitionStandingTable ¶
func (cli *Session) GetCompetitionStandingTable(current_id string) (StandingTable, error)
Returns standing table of a competition.
Parameters:
- current_id: competition current id.
func (*Session) GetCompetitionWeeks ¶
func (cli *Session) GetCompetitionWeeks(current_id string) (*CompetitionWeeks, error)
Returns competition weeks.
Parameters:
- current_id: competition current id.
func (*Session) GetCompetitionsList ¶
func (cli *Session) GetCompetitionsList(c_type string) (CompetitionsList, error)
Returns the competitions that are supported.
Parameters:
- c_type: competition type, (C)lub competitions or (N)ational competitions ( can be zero ).
func (*Session) GetMatchesByDate ¶
func (cli *Session) GetMatchesByDate(days int, slugs ...string) (CompetitionMatches, error)
Returns the matches of that date.
Parameters:
- days: days after today ( can be zero or negative ).
- slugs: the slugs of competitions that matches you want.
func (*Session) GetMatchesByWeekNumber ¶
func (cli *Session) GetMatchesByWeekNumber(current_id string, week_number uint32) ([]MatchBase, error)
Returns the matches of that week.
Parameters:
- week_number: week number.
- current_id: competition current id.
func (*Session) GetTransfersRegions ¶
func (cli *Session) GetTransfersRegions() (*TransfersRegions, error)
Returns the regions that have transfer.
func (*Session) RequestJSON ¶
func (s *Session) RequestJSON(req RequestConfig, obj interface{}) error
type StandingTable ¶
type StandingTable []struct { Team struct { // ID string `json:"id"` // Slug string `json:"slug"` Title string `json:"title"` // Logo string `json:"logo"` // Thumbnail string `json:"thumbnail"` // IsActive bool `json:"is_active"` // FullTitle string `json:"full_title"` // IsNational bool `json:"is_national"` // Country struct { // Name string `json:"name"` // } `json:"country"` ToBeDecided bool `json:"to_be_decided"` } `json:"team"` // Form []struct { // State string `json:"state"` // MatchID string `json:"match_id"` // Title string `json:"title"` // } `json:"form"` Rank int `json:"rank"` Score int `json:"score"` PlayedMatches int `json:"played_matches"` WonMatches int `json:"won_matches"` LostMatches int `json:"lost_matches"` ScoredGoals int `json:"scored_goals"` ConcededGoals int `json:"conceded_goals"` RedCards int `json:"red_cards"` YellowCards int `json:"yellow_cards"` GoalDifference int `json:"goal_difference"` TotalCards int `json:"total_cards"` RankChange int `json:"rank_change"` }
type StatusCodeError ¶
func (*StatusCodeError) Error ¶
func (e *StatusCodeError) Error() string
func (*StatusCodeError) MarshalJSON ¶
func (e *StatusCodeError) MarshalJSON() ([]byte, error)
type Suggests ¶
type Suggests struct { Teams TeamSuggests `json:"teams"` Players PlayerSuggests `json:"players"` Coaches CoacheSuggests `json:"coaches"` }
type Team ¶
type Team struct { ID string `json:"id"` Slug string `json:"slug"` Title string `json:"title"` Logo string `json:"logo"` // Thumbnail string `json:"thumbnail"` // IsActive bool `json:"is_active"` // FullTitle string `json:"full_title"` // IsNational bool `json:"is_national"` Country *struct { Name string `json:"name"` } `json:"country"` ToBeDecided bool `json:"to_be_decided"` }
type TeamSuggests ¶
type TeamSuggests struct { Count int `json:"count"` Results []Team `json:"results"` // contains filtered or unexported fields }
func (TeamSuggests) HasMore ¶
func (s TeamSuggests) HasMore() bool
func (TeamSuggests) Limit ¶
func (s TeamSuggests) Limit() uint16
func (TeamSuggests) Offset ¶
func (s TeamSuggests) Offset() uint16
type Transfers ¶
type Transfers []struct { ID string `json:"id"` // Slug string `json:"slug"` Title string `json:"title"` Logo string `json:"logo"` // Thumbnail string `json:"thumbnail"` // IsActive bool `json:"is_active"` // FullTitle string `json:"full_title"` // IsNational bool `json:"is_national"` Country struct { Name string `json:"name"` } `json:"country"` ToBeDecided bool `json:"to_be_decided"` // Order int `json:"order"` InTransfers []struct { TransferSeason string `json:"transfer_season"` Player struct { ID string `json:"id"` Slug string `json:"slug"` Fullname string `json:"fullname"` // Image string `json:"image"` // Position struct { // Key string `json:"key"` // Value string `json:"value"` // } `json:"position"` KitNumber int `json:"kit_number"` } `json:"player"` FromTeam Team `json:"from_team"` TransferTime int `json:"transfer_time"` TransferStatus struct { StatusID int `json:"status_id"` Name string `json:"name"` } `json:"transfer_status"` IsImportant bool `json:"is_important"` } `json:"in_transfers"` OutTransfers []struct { TransferSeason string `json:"transfer_season"` Player struct { ID string `json:"id"` Slug string `json:"slug"` Fullname string `json:"fullname"` // Image string `json:"image"` // Position struct { // Key string `json:"key"` // Value string `json:"value"` // } `json:"position"` KitNumber int `json:"kit_number"` } `json:"player"` ToTeam *Team `json:"to_team"` TransferTime int `json:"transfer_time"` TransferStatus struct { StatusID int `json:"status_id"` Name string `json:"name"` } `json:"transfer_status"` IsImportant bool `json:"is_important"` } `json:"out_transfers"` }
Click to show internal directories.
Click to hide internal directories.