Documentation
¶
Overview ¶
Package fotmob is Crawlora's FotMob API client for 31 endpoints, covering leagues, matches, fixtures, teams, players, search, standings, news, and rankings. API documentation: https://crawlora.net/docs?utm_source=pkg.go.dev&utm_medium=referral&utm_campaign=platform-clients&utm_content=fotmob-go-api-docs
Index ¶
- Constants
- func OperationIDs() []string
- type Client
- func (c *Client) AudioMatches(ctx context.Context, params Params) (any, error)
- func (c *Client) Call(ctx context.Context, operationID string, params Params) (any, error)
- func (c *Client) Close() error
- func (c *Client) FifaRankingPeriods(ctx context.Context, params Params) (any, error)
- func (c *Client) FifaRankings(ctx context.Context, params Params) (any, error)
- func (c *Client) LatestNews(ctx context.Context, params Params) (any, error)
- func (c *Client) League(ctx context.Context, params Params) (any, error)
- func (c *Client) Leagues(ctx context.Context, params Params) (any, error)
- func (c *Client) LineupBuilderPlayers(ctx context.Context, params Params) (any, error)
- func (c *Client) LineupBuilderTeam(ctx context.Context, params Params) (any, error)
- func (c *Client) Match(ctx context.Context, params Params) (any, error)
- func (c *Client) MatchMedia(ctx context.Context, params Params) (any, error)
- func (c *Client) Matches(ctx context.Context, params Params) (any, error)
- func (c *Client) News(ctx context.Context, params Params) (any, error)
- func (c *Client) NewsArticle(ctx context.Context, params Params) (any, error)
- func (c *Client) Player(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerMatchStats(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerMatches(ctx context.Context, params Params) (any, error)
- func (c *Client) PlayerStats(ctx context.Context, params Params) (any, error)
- func (c *Client) Search(ctx context.Context, params Params) (any, error)
- func (c *Client) Seasons(ctx context.Context, params Params) (any, error)
- func (c *Client) Stats(ctx context.Context, params Params) (any, error)
- func (c *Client) StatsCategories(ctx context.Context, params Params) (any, error)
- func (c *Client) Table(ctx context.Context, params Params) (any, error)
- func (c *Client) Team(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamFixtures(ctx context.Context, params Params) (any, error)
- func (c *Client) TeamNews(ctx context.Context, params Params) (any, error)
- func (c *Client) Transfers(ctx context.Context, params Params) (any, error)
- func (c *Client) TrendingNews(ctx context.Context, params Params) (any, error)
- func (c *Client) TrendingSearches(ctx context.Context, params Params) (any, error)
- func (c *Client) TvGuide(ctx context.Context, params Params) (any, error)
- func (c *Client) TvGuideChannels(ctx context.Context, params Params) (any, error)
- func (c *Client) TvGuideCountries(ctx context.Context, params Params) (any, error)
- type Params
Examples ¶
Constants ¶
const ( DefaultBaseURL = "https://api.crawlora.net/api/v1" Version = "0.1.10" )
const OperationCount = 31
OperationCount reports how many selected-platform operations this module exposes.
Variables ¶
This section is empty.
Functions ¶
func OperationIDs ¶
func OperationIDs() []string
OperationIDs returns the selected operation IDs in stable sorted order.
Types ¶
type Client ¶
Client calls only the operation IDs included in this platform module.
func NewClient ¶
NewClient creates a client using the supplied API key, or CRAWLORA_API_KEY when empty.
func (*Client) AudioMatches ¶
AudioMatches calls the fotmob-audio-matches operation.
func (*Client) Call ¶
Call executes a selected platform operation by operation ID.
Example ¶
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
_, _ = w.Write([]byte(`{"ok":true}`))
}))
defer server.Close()
client := NewClient("your-crawlora-api-key")
client.BaseURL = server.URL + "/api/v1"
client.HTTPClient = server.Client()
result, err := client.Call(context.Background(), "fotmob-audio-matches", Params{})
if err != nil {
panic(err)
}
fmt.Println(result.(map[string]any)["ok"])
Output: true
func (*Client) FifaRankingPeriods ¶
FifaRankingPeriods calls the fotmob-fifa-ranking-periods operation.
func (*Client) FifaRankings ¶
FifaRankings calls the fotmob-fifa-rankings operation.
func (*Client) LatestNews ¶
LatestNews calls the fotmob-latest-news operation.
func (*Client) LineupBuilderPlayers ¶
LineupBuilderPlayers calls the fotmob-lineup-builder-players operation.
func (*Client) LineupBuilderTeam ¶
LineupBuilderTeam calls the fotmob-lineup-builder-team operation.
func (*Client) MatchMedia ¶
MatchMedia calls the fotmob-match-media operation.
func (*Client) NewsArticle ¶
NewsArticle calls the fotmob-news-article operation.
func (*Client) PlayerMatchStats ¶
PlayerMatchStats calls the fotmob-player-match-stats operation.
func (*Client) PlayerMatches ¶
PlayerMatches calls the fotmob-player-matches operation.
func (*Client) PlayerStats ¶
PlayerStats calls the fotmob-player-stats operation.
func (*Client) StatsCategories ¶
StatsCategories calls the fotmob-stats-categories operation.
func (*Client) TeamFixtures ¶
TeamFixtures calls the fotmob-team-fixtures operation.
func (*Client) TrendingNews ¶
TrendingNews calls the fotmob-trending-news operation.
func (*Client) TrendingSearches ¶
TrendingSearches calls the fotmob-trending-searches operation.
func (*Client) TvGuideChannels ¶
TvGuideChannels calls the fotmob-tv-guide-channels operation.