msf

package module
v2.4.13+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 8 Imported by: 2

README

mysportsfeeds-go

Go library to use MySportsFeeds API

Example Use

import (
    msf "github.com/joelhill/mysportsfeeds-go"
)

authorization := "Basic asfafasdfasdfasdfasasdfsadfasdfsd"
config := msf.NewConfig(authorization)
client := msf.NewService(config)
options := client.NewSeasonalGamesOptions()
games, statusCode, err := client.SeasonalGames(options)
if err != nil {
    log.Println("something went wrong")
}

Documentation

Index

Constants

View Source
const (
	// VersionV1_1 - v1.1
	VersionV1_1 = "v1.1"

	// VersionV1_2 - v1.2
	VersionV1_2 = "v1.2"

	// VersionV2_0 - v2.0
	VersionV2_0 = "v2.0"

	// VersionV2_1 - v2.1
	VersionV2_1 = "v2.1"
)

VERSION

View Source
const (
	// SportMLB - baseball
	SportMLB = "mlb"

	// SportNFL - football
	SportNFL = "nfl"

	// SportNBA - Basketball
	SportNBA = "nba"

	// SportNHL - Hockey
	SportNHL = "nhl"
)

SPORT

View Source
const (
	// FormatJSON - returns the format in json
	FormatJSON = "json"

	// FormatXML - returns the format in xml
	FormatXML = "xml"

	// FormatCSV - returns the format in csv
	FormatCSV = "csv"
)

RETURN FORMAT

View Source
const (
	// SeasonCurrent - current season
	SeasonCurrent = "current"

	// SeasonLatest - latest season
	SeasonLatest = "latest"

	// SeasonUpcoming - upcoming season
	SeasonUpcoming = "upcoming"
)

SEASON

View Source
const (
	// DateYesterday -
	DateYesterday = "yesterday"

	// DateToday -
	DateToday = "today"

	// DateTomorrow -
	DateTomorrow = "tomorrow"

	// Date2019Season -
	Date2019Season = "2019-regular"
)

DATE

View Source
const (
	// StatusUnplayed - returns games scheduled but not yet started
	StatusUnplayed = "unplayed"

	// StatusInProgress - returns games currently underway
	StatusInProgress = "in-progress"

	// StatusPostgameReviewing - returns game is over, but we're reviewing against official sources
	StatusPostgameReviewing = "postgame-reviewing"

	// StatusFinal - returns game is final and reviewed
	StatusFinal = "final"
)

STATUS

View Source
const (
	// CompressionHeaderGzip - type of compression header
	CompressionHeaderGzip = "gzip"
)
View Source
const (
	// URL - api url
	MySportsFeedBaseURL = "https://api.mysportsfeeds.com"
)

ADDRESS

Variables

This section is empty.

Functions

This section is empty.

Types

type Actual

type Actual struct {
	LineupPositions *[]LineupPosition `json:"lineupPositions"`
}

type AtBat

type AtBat struct {
	Inning      *int         `json:"inning"`
	InningHalf  *string      `json:"inningHalf"`
	BattingTeam *Team        `json:"battingTeam"`
	AtBatPlay   *[]AtBatPlay `json:"atBatPlay"`
}

type AtBatPlay

type AtBatPlay struct {
	BatterUp *BatterUp `json:"batterUp"`
	// TODO: fill these out
	// Pitch          *Pitch          `json:"pitch"`
	// PickoffAttempt *PickoffAttempt `json:"pickoffAttempt"`
	// Hit            *Hit            `json:"hit"`
	// BaseRunAttempt *BaseRunAttempt `json:"baseRunAttempt"`
	// BallThrow      *BallThrow      `json:"ballThrow"`
	Description *string `json:"description"`
}

type AwayTeam

type AwayTeam struct {
	ID           int    `json:"id"`
	Abbreviation string `json:"abbreviation"`
}

type BatterUp

type BatterUp struct {
	BattingPlayer       *Player `json:"battingPlayer"`
	StandingLeftOrRight *string `json:"standingLeftOrRight"`
	Result              *string `json:"result"`
}

type Batting

type Batting struct {
	AtBats                       *int     `json:"atBats"`
	Runs                         *int     `json:"runs"`
	Hits                         *int     `json:"hits"`
	SecondBaseHits               *int     `json:"secondBaseHits"`
	ThirdBaseHits                *int     `json:"thirdBaseHits"`
	Homeruns                     *int     `json:"homeruns"`
	EarnedRuns                   *int     `json:"earnedRuns"`
	UnearnedRuns                 *int     `json:"unearnedRuns"`
	RunsBattedIn                 *int     `json:"runsBattedIn"`
	BatterWalks                  *int     `json:"batterWalks"`
	BatterSwings                 *int     `json:"batterSwings"`
	BatterStrikes                *int     `json:"batterStrikes"`
	BatterStrikesFoul            *int     `json:"batterStrikesFoul"`
	BatterStrikesMiss            *int     `json:"batterStrikesMiss"`
	BatterStrikesLooking         *int     `json:"batterStrikesLooking"`
	BatterTagOuts                *int     `json:"batterTagOuts"`
	BatterForceOuts              *int     `json:"batterForceOuts"`
	BatterPutOuts                *int     `json:"batterPutOuts"`
	BatterGroundBalls            *int     `json:"batterGroundBalls"`
	BatterFlyBalls               *int     `json:"batterFlyBalls"`
	BatterLineDrives             *int     `json:"batterLineDrives"`
	Batter2SeamFastballs         *int     `json:"batter2SeamFastballs"`
	Batter4SeamFastballs         *int     `json:"batter4SeamFastballs"`
	BatterCurveballs             *int     `json:"batterCurveballs"`
	BatterChangeups              *int     `json:"batterChangeups"`
	BatterCutters                *int     `json:"batterCutters"`
	BatterSliders                *int     `json:"batterSliders"`
	BatterSinkers                *int     `json:"batterSinkers"`
	BatterSplitters              *int     `json:"batterSplitters"`
	BatterStrikeouts             *int     `json:"batterStrikeouts"`
	StolenBases                  *int     `json:"stolenBases"`
	CaughtBaseSteals             *int     `json:"caughtBaseSteals"`
	BatterStolenBasePct          *float64 `json:"batterStolenBasePct"`
	BattingAvg                   *float64 `json:"battingAvg"`
	BatterOnBasePct              *float64 `json:"batterOnBasePct"`
	BatterSluggingPct            *float64 `json:"batterSluggingPct"`
	BatterOnBasePlusSluggingPct  *float64 `json:"batterOnBasePlusSluggingPct"`
	BatterIntentionalWalks       *int     `json:"batterIntentionalWalks"`
	HitByPitch                   *int     `json:"hitByPitch"`
	BatterSacrificeBunts         *int     `json:"batterSacrificeBunts"`
	BatterSacrificeFlies         *int     `json:"batterSacrificeFlies"`
	TotalBases                   *int     `json:"totalBases"`
	ExtraBaseHits                *int     `json:"extraBaseHits"`
	BatterDoublePlays            *int     `json:"batterDoublePlays"`
	BatterTriplePlays            *int     `json:"batterTriplePlays"`
	BatterGroundOuts             *int     `json:"batterGroundOuts"`
	BatterFlyOuts                *int     `json:"batterFlyOuts"`
	BatterGroundOutToFlyOutRatio *float64 `json:"batterGroundOutToFlyOutRatio"`
	PitchesFaced                 *int     `json:"pitchesFaced"`
	PlateAppearances             *int     `json:"plateAppearances"`
	LeftOnBase                   *int     `json:"leftOnBase"`
}

type BoxscoreIO

type BoxscoreIO struct {
	LastUpdatedOn string         `json:"lastUpdatedOn"`
	Game          *Schedule      `json:"game"`
	Scoring       *Score         `json:"scoring"`
	Stats         *StatsHomeAway `json:"stats"`
	References    *References    `json:"references"`
}

type BoxscoreStats

type BoxscoreStats struct {
	TeamStats *[]Stats   `json:"teamStats"`
	Players   *[]Players `json:"players"`
}

type Config

type Config struct {
	// Authorization - your basic authentication
	// Required to hit any mysportsfeeds api endpoints
	Authorization string

	// BaseURL - the base url for my sports feeds api
	// Defaults to "https://api.mysportsfeeds.com"
	BaseURL string

	// Version - what version of the mysportsfeeds api you want to hit.
	// Defaults to "2.0"
	Version string

	// Sport - what sport you want data back from
	// Defaults to "mlb"
	Sport string

	// Format - what format you want to receive back from the api
	// Defaults to "json"
	Format string

	// Season - what season you want to access from the api
	// Defaults to "current"
	Season string
}

Config - holds your authorization

func NewConfig

func NewConfig(authorization string) *Config

NewConfig -

type CurrentContractYear

type CurrentContractYear struct {
	SeasonStartYear       int              `json:"seasonStartYear"`
	BaseSalary            int              `json:"baseSalary"`
	MinorsSalary          int              `json:"minorsSalary"`
	SigningBonus          int              `json:"signingBonus"`
	OtherBonuses          int              `json:"otherBonuses"`
	CapHit                interface{}      `json:"capHit"`
	FullNoTradeClause     bool             `json:"fullNoTradeClause"`
	ModifiedNoTradeClause bool             `json:"modifiedNoTradeClause"`
	NoMovementClause      bool             `json:"noMovementClause"`
	OverallContract       *OverallContract `json:"overallContract"`
}

type CurrentInjury

type CurrentInjury struct {
	Description        *string `json:"description"`
	PlayingProbability *string `json:"playingProbability"`
}

type CurrentSeasonIO

type CurrentSeasonIO struct {
	LastUpdatedOn string    `json:"lastUpdatedOn"`
	Seasons       *[]Season `json:"seasons"`
}

type CurrentSeasonOptions

type CurrentSeasonOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Format  string

	// Optional URL Params
	Date  string
	Force string
}

CurrentSeasonOptions - Are the options to hit the current season endpoint

type DailyDfsOptions

type DailyDfsOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Date    string
	Format  string

	// Optional URL Params
	Team     string
	Player   string
	Position string
	Country  string
	DfsType  string
	Sort     string
	Offset   string
	Limit    string
	Force    string
}

DailyDfsOptions - Are the options to hit the daily DFS endpoint

type DailyGamesOptions

type DailyGamesOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Date    string //YYYYMMDD
	Format  string

	// Optional URL Params
	Team   string
	Status string
	Sort   string
	Offset string
	Limit  string
	Force  string
}

DailyGamesOptions - Are the options to hit the daily games endpoint

type DailyPlayerGamelogsOptions

type DailyPlayerGamelogsOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Date    string // YYYYMMDD
	Week    string // 1-40
	Format  string

	// Optional URL Params
	Team     string
	Player   string
	Position string
	Game     string
	Stats    string
	Sort     string
	Offset   string
	Limit    string
	Force    string
}

DailyPlayerGamelogsOptions - Are the options to hit the daily player gamelogs endpoint

type DailyStandingsOptions

type DailyStandingsOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Format  string

	// Optional URL Params
	Date  string
	Team  string
	Stats string
	Force string
}

DailyStandingsOptions - Are the options to hit the daily standings endpoint

type DailyTeamGamelogsOptions

type DailyTeamGamelogsOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Date    string // YYYYMMDD
	Format  string

	// Optional URL Params
	Team   string
	Game   string
	Stats  string
	Sort   string
	Offset string
	Limit  string
	Force  string
}

DailyTeamGamelogsOptions - Are the options to hit the daily team gamelogs endpoint

type DfsIO

type DfsIO struct {
	LastUpdatedOn string      `json:"lastUpdatedOn"`
	References    *References `json:"references"`
}

type Drafted

type Drafted struct {
	Year        *int  `json:"year"`
	Team        *Team `json:"team"`
	PickTeam    *Team `json:"pickTeam"`
	Round       *int  `json:"round"`
	RoundPick   *int  `json:"roundPick"`
	OverallPick *int  `json:"overallPick"`
}

type Expected

type Expected struct {
	LineupPositions *[]LineupPosition `json:"lineupPositions"`
}

type ExternalMapping

type ExternalMapping struct {
	Source *string     `json:"source"`
	ID     interface{} `json:"id"`
}

type Feed

type Feed struct {
	Name         *string `json:"name"`
	Version      *string `json:"version"`
	Abbreviation *string `json:"abbreviation"`
	Description  *string `json:"description"`
}

type FeedUpdate

type FeedUpdate struct {
	Feed          *Feed      `json:"feed"`
	ForDate       *[]ForDate `json:"forDates"`
	ForGames      *[]ForGame `json:"forGames"`
	LastUpdatedOn *string    `json:"lastUpdatedOn"`
}

type FeedUpdatesIO

type FeedUpdatesIO struct {
	LastUpdatedOn string        `json:"lastUpdatedOn"`
	FeedUpdates   *[]FeedUpdate `json:"feedUpdates"`
}

type FeedUpdatesOptions

type FeedUpdatesOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Format  string

	// Optional URL Params
	Force string
}

FeedUpdatesOptions - Are the options to hit the feed updates endpoint

type Fielding

type Fielding struct {
	InningsPlayed             *float64 `json:"inningsPlayed"`
	TotalChances              *int     `json:"totalChances"`
	FielderTagOuts            *int     `json:"fielderTagOuts"`
	FielderForceOuts          *int     `json:"fielderForceOuts"`
	FielderPutOuts            *int     `json:"fielderPutOuts"`
	OutsFaced                 *int     `json:"outsFaced"`
	Assists                   *int     `json:"assists"`
	Errors                    *int     `json:"errors"`
	FielderDoublePlays        *int     `json:"fielderDoublePlays"`
	FielderTriplePlays        *int     `json:"fielderTriplePlays"`
	FielderStolenBasesAllowed *int     `json:"fielderStolenBasesAllowed"`
	FielderCaughtStealing     *int     `json:"fielderCaughtStealing"`
	FielderStolenBasePct      *float64 `json:"fielderStolenBasePct"`
	PassedBalls               *int     `json:"passedBalls"`
	FielderWildPitches        *int     `json:"fielderWildPitches"`
	FieldingPct               *float64 `json:"fieldingPct"`
	DefenceEfficiencyRatio    *float64 `json:"defenceEfficiencyRatio"`
	RangeFactor               *float64 `json:"rangeFactor"`
}

type ForDate

type ForDate struct {
	ForDate       *string `json:"forDate"`
	LastUpdatedOn *string `json:"lastUpdatedOn"`
}

type ForGame

type ForGame struct {
	Game          *Schedule `json:"game"`
	LastUpdatedOn *string   `json:"lastUpdatedOn"`
}

type Game

type Game struct {
	Schedule *Schedule `json:"schedule"`
	Score    *Score    `json:"score"`
}

Sub Models

type GameBoxscoreOptions

type GameBoxscoreOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Game    string
	Format  string

	// Optional URL Params
	TeamStats   string
	PlayerStats string
	Sort        string
	Offset      string
	Limit       string
	Force       string
}

GameBoxscoreOptions - Are the options to hit the game boxscore endpoint

type GameLineupIO

type GameLineupIO struct {
	LastUpdatedOn string        `json:"lastUpdatedOn"`
	Game          *Schedule     `json:"game"`
	TeamLineups   *[]TeamLineup `json:"teamLineups"`
	References    *References   `json:"references"`
}

type GameLineupOptions

type GameLineupOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Game    string
	Format  string

	// Optional URL Params
	Position   string
	LineupType string
	Force      string
}

GameLineupOptions - Are the options to hit the game lineup endpoint

type GameLog

type GameLog struct {
	Game   *GameLogGame `json:"game"`
	Player *Player      `json:"player"`
	Team   *Team        `json:"team"`
	Stats  *Stats       `json:"stats"`
}

type GameLogGame

type GameLogGame struct {
	ID                   int    `json:"id"`
	StartTime            string `json:"startTime"`
	AwayTeamAbbreviation string `json:"awayTeamAbbreviation"`
	HomeTeamAbbreviation string `json:"homeTeamAbbreviation"`
}

type GameLogIO

type GameLogIO struct {
	LastUpdatedOn string      `json:"lastUpdatedOn"`
	GameLog       *[]GameLog  `json:"gamelogs"`
	References    *References `json:"references"`
}

type GamePlayByPlayIO

type GamePlayByPlayIO struct {
	LastUpdatedOn string      `json:"lastUpdatedOn"`
	Game          *Schedule   `json:"game"`
	AtBats        *[]AtBat    `json:"atBats"`
	References    *References `json:"references"`
}

type GamePlayByPlayOptions

type GamePlayByPlayOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Game    string
	Format  string

	// Optional URL Params
	Playtype string
	Sort     string
	Offset   string
	Limit    string
	Force    string
}

GamePlayByPlayOptions - Are the options to hit the seasonal DFS endpoint

type GameReference

type GameReference struct {
	ID                       int      `json:"id"`
	StartTime                string   `json:"startTime"`
	AwayTeam                 AwayTeam `json:"awayTeam"`
	HomeTeam                 HomeTeam `json:"homeTeam"`
	Venue                    Venue    `json:"venue"`
	VenueAllegiance          string   `json:"venueAllegiance"`
	ScheduleStatus           string   `json:"scheduleStatus"`
	OriginalStartTime        *string  `json:"originalStartTime"`
	DelayedOrPostponedReason *string  `json:"delayedOrPostponedReason"`
	PlayedStatus             *string  `json:"playedStatus"`
}

type GamesIO

type GamesIO struct {
	LastUpdatedOn string      `json:"lastUpdatedOn"`
	Games         *[]Game     `json:"games"`
	References    *References `json:"references"`
}

Main Models

type Handedness

type Handedness struct {
	Bats   string `json:"bats"`
	Throws string `json:"throws"`
}

type HomeTeam

type HomeTeam struct {
	ID           int    `json:"id"`
	Abbreviation string `json:"abbreviation"`
}

type HomeVenue

type HomeVenue struct {
	ID   *int    `json:"id"`
	Name *string `json:"name"`
}

type IService

type IService interface {
	NewCurrentSeasonOptions() *CurrentSeasonOptions
	CurrentSeason(options *CurrentSeasonOptions) (CurrentSeasonIO, int, error)

	NewDailyDfsOptions() *DailyDfsOptions
	DailyDfs(options *DailyDfsOptions) (DfsIO, int, error)

	NewDailyGamesOptions() *DailyGamesOptions
	DailyGames(options *DailyGamesOptions) (GamesIO, int, error)

	NewDailyPlayerGamelogsOptions() *DailyPlayerGamelogsOptions
	DailyPlayerGamelogs(options *DailyPlayerGamelogsOptions) (GameLogIO, int, error)

	NewDailyStandingsOptions() *DailyStandingsOptions
	DailyStandings(options *DailyStandingsOptions) (StandingsIO, int, error)

	NewDailyTeamGamelogsOptions() *DailyTeamGamelogsOptions
	DailyTeamGamelogs(options *DailyTeamGamelogsOptions) (GameLogIO, int, error)

	NewFeedUpdatesOptions() *FeedUpdatesOptions
	FeedUpdates(options *FeedUpdatesOptions) (FeedUpdatesIO, int, error)

	NewGameBoxscoreOptions() *GameBoxscoreOptions
	GameBoxscore(options *GameBoxscoreOptions) (BoxscoreIO, int, error)

	NewGameLineupOptions() *GameLineupOptions
	GameLineup(options *GameLineupOptions) (GameLineupIO, int, error)

	NewGamePlayByPlayOptions() *GamePlayByPlayOptions
	GamePlayByPlay(options *GamePlayByPlayOptions) (GamePlayByPlayIO, int, error)

	NewPlayerInjuriesOptions() *PlayerInjuriesOptions
	PlayerInjuries(options *PlayerInjuriesOptions) (PlayerInjuriesIO, int, error)

	NewPlayersOptions() *PlayersOptions
	Players(options *PlayersOptions) (PlayersIO, int, error)

	NewSeasonalDfsOptions() *SeasonalDfsOptions
	SeasonalDfs(options *SeasonalDfsOptions) (DfsIO, int, error)

	NewSeasonalGamesOptions() *SeasonalGamesOptions
	SeasonalGames(options *SeasonalGamesOptions) (GamesIO, int, error)

	NewSeasonalPlayerGamelogsOptions() *SeasonalPlayerGamelogsOptions
	SeasonalPlayerGamelogs(options *SeasonalPlayerGamelogsOptions) (GameLogIO, int, error)

	NewSeasonalPlayerStatsOptions() *SeasonalPlayerStatsOptions
	SeasonalPlayerStats(options *SeasonalPlayerStatsOptions) (PlayerStatsTotalsIO, int, error)

	NewSeasonalTeamGamelogsOptions() *SeasonalTeamGamelogsOptions
	SeasonalTeamGamelogs(options *SeasonalTeamGamelogsOptions) (GameLogIO, int, error)

	NewSeasonalTeamStatsOptions() *SeasonalTeamStatsOptions
	SeasonalTeamStats(options *SeasonalTeamStatsOptions) (TeamStatsTotalsIO, int, error)

	NewSeasonalVenuesOptions() *SeasonalVenuesOptions
	SeasonalVenues(options *SeasonalVenuesOptions) (VenuesIO, int, error)
}

IService - all functions that implement the My Sports Feed Service Interface.

type Inning

type Inning struct {
	InningNumber *int           `json:"inningNumber"`
	AwayScore    *int           `json:"awayScore"`
	HomeScore    *int           `json:"homeScore"`
	ScoringPlays *[]ScoringPlay `json:"scoringPlays"`
}

type LineupPosition

type LineupPosition struct {
	Position *string `json:"position"`
	Player   *Player `json:"player"`
}

type Miscellaneous

type Miscellaneous struct {
	GamesStarted *int `json:"gamesStarted"`
}

type OverallContract

type OverallContract struct {
	SigningTeam         *SigningTeam `json:"signingTeam"`
	SignedOn            interface{}  `json:"signedOn"`
	TotalYears          int          `json:"totalYears"`
	TotalSalary         int          `json:"totalSalary"`
	TotalBonuses        int          `json:"totalBonuses"`
	ExpiryStatus        interface{}  `json:"expiryStatus"`
	AnnualAverageSalary int          `json:"annualAverageSalary"`
}

type Pitching

type Pitching struct {
	Wins                          *int     `json:"wins"`
	Losses                        *int     `json:"losses"`
	EarnedRunAvg                  *float64 `json:"earnedRunAvg"`
	Saves                         *int     `json:"saves"`
	SaveOpportunities             *int     `json:"SaveOpportunities"`
	InningsPitched                *float64 `json:"inningsPitched"`
	HitsAllowed                   *int     `json:"hitsAllowed"`
	SecondBaseHitsAllowed         *int     `json:"secondBaseHitsAllowed"`
	ThirdBaseHitsAllowed          *int     `json:"thirdBaseHitsAllowed"`
	RunsAllowed                   *int     `json:"runsAllowed"`
	EarnedRunsAllowed             *int     `json:"earnedRunsAllowed"`
	HomerunsAllowed               *int     `json:"homerunsAllowed"`
	PitcherWalks                  *int     `json:"pitcherWalks"`
	PitcherSwings                 *int     `json:"pitcherSwings"`
	PitcherStrikes                *int     `json:"pitcherStrikes"`
	PitcherStrikesFoul            *int     `json:"pitcherStrikesFoul"`
	PitcherStrikesMiss            *int     `json:"pitcherStrikesMiss"`
	PitcherStrikesLooking         *int     `json:"pitcherStrikesLooking"`
	PitcherGroundBalls            *int     `json:"pitcherGroundBalls"`
	PitcherFlyBalls               *int     `json:"pitcherFlyBalls"`
	PitcherLineDrives             *int     `json:"pitcherLineDrives"`
	Pitcher2SeamFastballs         *int     `json:"pitcher2SeamFastballs"`
	Pitcher4SeamFastballs         *int     `json:"pitcher4SeamFastballs"`
	PitcherCurveballs             *int     `json:"pitcherCurveballs"`
	PitcherChangeups              *int     `json:"pitcherChangeups"`
	PitcherCutters                *int     `json:"pitcherCutters"`
	PitcherSliders                *int     `json:"pitcherSliders"`
	PitcherSinkers                *int     `json:"pitcherSinkers"`
	PitcherSplitters              *int     `json:"pitcherSplitters"`
	PitcherSacrificeBunts         *int     `json:"pitcherSacrificeBunts"`
	PitcherSacrificeFlies         *int     `json:"pitcherSacrificeFlies"`
	PitcherStrikeouts             *int     `json:"pitcherStrikeouts"`
	PitchingAvg                   *float64 `json:"pitchingAvg"`
	WalksAndHitsPerInningPitched  *float64 `json:"walksAndHitsPerInningPitched"`
	CompletedGames                *int     `json:"completedGames"`
	Shutouts                      *int     `json:"shutouts"`
	BattersHit                    *int     `json:"battersHit"`
	PitcherIntentionalWalks       *int     `json:"pitcherIntentionalWalks"`
	GamesFinished                 *int     `json:"gamesFinished"`
	Holds                         *int     `json:"holds"`
	PitcherDoublePlays            *int     `json:"pitcherDoublePlays"`
	PitcherTriplePlays            *int     `json:"pitcherTriplePlays"`
	PitcherGroundOuts             *int     `json:"pitcherGroundOuts"`
	PitcherFlyOuts                *int     `json:"pitcherFlyOuts"`
	PitcherWildPitches            *int     `json:"pitcherWildPitches"`
	Balks                         *int     `json:"balks"`
	PitcherStolenBasesAllowed     *int     `json:"pitcherStolenBasesAllowed"`
	PitcherCaughtStealing         *int     `json:"pitcherCaughtStealing"`
	Pickoffs                      *int     `json:"pickoffs"`
	PickoffAttempts               *int     `json:"pickoffAttempts"`
	TotalBattersFaced             *int     `json:"totalBattersFaced"`
	PitchesThrown                 *int     `json:"pitchesThrown"`
	WinPct                        *float64 `json:"winPct"`
	PitcherGroundOutToFlyOutRatio *float64 `json:"pitcherGroundOutToFlyOutRatio"`
	PitcherOnBasePct              *float64 `json:"pitcherOnBasePct"`
	PitcherSluggingPct            *float64 `json:"pitcherSluggingPct"`
	PitcherOnBasePlusSluggingPct  *float64 `json:"pitcherOnBasePlusSluggingPct"`
	StrikeoutsPer9Innings         *float64 `json:"strikeoutsPer9Innings"`
	WalksAllowedPer9Innings       *float64 `json:"walksAllowedPer9Innings"`
	HitsAllowedPer9Innings        *float64 `json:"hitsAllowedPer9Innings"`
	StrikeoutsToWalksRatio        *float64 `json:"strikeoutsToWalksRatio"`
	PitchesPerInning              *float64 `json:"pitchesPerInning"`
	PitcherAtBats                 *int     `json:"pitcherAtBats"`
}

type Player

type Player struct {
	ID                  int                  `json:"id"`
	FirstName           string               `json:"firstName"`
	LastName            string               `json:"lastName"`
	PrimaryPosition     string               `json:"primaryPosition"`
	AlternatePositions  interface{}          `json:"alternatePositions"`
	JerseyNumber        *int                 `json:"jerseyNumber"`
	CurrentTeam         *Team                `json:"currentTeam"`
	CurrentRosterStatus *string              `json:"currentRosterStatus"`
	CurrentInjury       *CurrentInjury       `json:"currentInjury"`
	Height              *string              `json:"height"`
	Weight              *string              `json:"weight"`
	Age                 *int                 `json:"age"`
	Rookie              *bool                `json:"rookie"`
	Handedness          interface{}          `json:"handedness"`
	OfficialImageSrc    *string              `json:"officialImageSrc"`
	SocialMediaAccounts interface{}          `json:"socialMediaAccounts"`
	CurrentContractYear *CurrentContractYear `json:"currentContractYear"`
	Drafted             Drafted              `json:"drafted"`
	ExternalMappings    []ExternalMapping    `json:"externalMappings"`
}

type PlayerInjuriesIO

type PlayerInjuriesIO struct {
	LastUpdatedOn string             `json:"lastUpdatedOn"`
	Players       *[]PlayerReference `json:"players"`
}

type PlayerInjuriesOptions

type PlayerInjuriesOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Format  string

	// Optional URL Params
	Player   string
	Team     string
	Position string
	Sort     string
	Offset   string
	Limit    string
	Force    string
}

PlayerInjuriesOptions - Are the options to hit the player injuries endpoint

type PlayerReference

type PlayerReference struct {
	Player
	Height           *string          `json:"height"`
	Weight           *float64         `json:"weight"`
	BirthDate        *string          `json:"birthDate"`
	Age              *int             `json:"age"`
	BirthCity        *string          `json:"birthCity"`
	BirthCountry     *string          `json:"birthCountry"`
	Rookie           *bool            `json:"rookie"`
	College          *string          `json:"college"`
	Twitter          *string          `json:"twitter"`
	Handedness       *Handedness      `json:"handedness"`
	Drafted          *Drafted         `json:"drafted"`
	OfficialImageSrc *string          `json:"officialImageSrc"`
	ExternalMapping  *ExternalMapping `json:"externalMapping"`
}

type PlayerStatsTotal

type PlayerStatsTotal struct {
	Player *PlayerReference `json:"player"`
	Team   *Team            `json:"team"`
	Stats  *Stats           `json:"stats"`
}

type PlayerStatsTotalsIO

type PlayerStatsTotalsIO struct {
	LastUpdatedOn     string              `json:"lastUpdatedOn"`
	PlayerStatsTotals *[]PlayerStatsTotal `json:"playerStatsTotals"`
	References        *References         `json:"references"`
}

type Players

type Players struct {
	Player       *PlayerReference `json:"player"`
	TeamAsOfDate *Team            `json:"teamAsOfDate"`
	PlayerStats  *[]Stats         `json:"playerStats"`
}

type PlayersIO

type PlayersIO struct {
	LastUpdatedOn string      `json:"lastUpdatedOn"`
	Players       *[]Players  `json:"players"`
	References    *References `json:"references"`
}

type PlayersOptions

type PlayersOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Format  string

	// Optional URL Params
	Date         string
	Team         string
	RosterStatus string
	Player       string
	Position     string
	Country      string
	Sort         string
	Offset       string
	Limit        string
	Force        string
}

PlayersOptions - Are the options to hit the players endpoint

type Rank

type Rank struct {
	ConferenceName *string  `json:"conferenceName"`
	DivisionName   *string  `json:"divisionName"`
	AppliesTo      *string  `json:"appliesTo"`
	Rank           *int     `json:"rank"`
	GamesBack      *float64 `json:"gamesBack"`
}

type References

type References struct {
	TeamReferences       *[]TeamReference   `json:"teamReferences"`
	TeamStatReferences   *[]StatReference   `json:"teamStatReferences"`
	VenueReferences      *[]VenueReference  `json:"venueReferences"`
	GameReferences       *[]GameReference   `json:"gameReferences"`
	PlayerReferences     *[]PlayerReference `json:"playerReferences"`
	PlayerStatReferences *[]StatReference   `json:"playerStatReferences"`
}

type Schedule

type Schedule struct {
	ID                       int      `json:"id"`
	StartTime                string   `json:"startTime"`
	AwayTeam                 AwayTeam `json:"awayTeam"`
	HomeTeam                 HomeTeam `json:"homeTeam"`
	Venue                    Venue    `json:"venue"`
	VenueAllegiance          string   `json:"venueAllegiance"`
	ScheduleStatus           string   `json:"scheduleStatus"`
	OriginalStartTime        *string  `json:"originalStartTime"`
	DelayedOrPostponedReason *string  `json:"delayedOrPostponedReason"`
	PlayedStatus             string   `json:"playedStatus"`
}

type Score

type Score struct {
	CurrentInning       *int      `json:"currentInning"`
	CurrentInningHalf   *string   `json:"currentInningHalf"`
	CurrentIntermission *int      `json:"currentIntermission"`
	AwayScoreTotal      *int      `json:"awayScoreTotal"`
	AwayHitsTotal       *int      `json:"awayHitsTotal"`
	AwayErrorsTotal     *int      `json:"awayErrorsTotal"`
	HomeScoreTotal      *int      `json:"homeScoreTotal"`
	HomeHitsTotal       *int      `json:"homeHitsTotal"`
	HomeErrorsTotal     *int      `json:"homeErrorsTotal"`
	Innings             []*Inning `json:"innings"`
}

type ScoringPlay

type ScoringPlay struct {
	InningHalf      *string `json:"inningHalf"`
	Team            *Team   `json:"team"`
	ScoreChange     *int    `json:"scoreChange"`
	AwayScore       *int    `json:"awayScore"`
	HomeScore       *int    `json:"homeScore"`
	PlayDescription *string `json:"playDescription"`
}

type Season

type Season struct {
	Name                 *string          `json:"name"`
	Slug                 *string          `json:"slug"`
	StartDate            *string          `json:"startDate"`
	EndDate              *string          `json:"endDate"`
	SeasonInterval       *string          `json:"seasonInterval"`
	SupportedTeamStats   *[]StatReference `json:"supportedTeamStats"`
	SupportedPlayerStats *[]StatReference `json:"supportedPlayerStats"`
}

type SeasonalDfsOptions

type SeasonalDfsOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Format  string

	// Optional URL Params
	Team     string
	Player   string
	Position string
	Country  string
	DfsType  string
	Sort     string
	Offset   string
	Limit    string
	Force    string
}

SeasonalDfsOptions - Are the options to hit the seasonal DFS endpoint

type SeasonalGamesOptions

type SeasonalGamesOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Format  string

	// Optional URL Params
	Team   string
	Date   string
	Status string
	Sort   string
	Offset string
	Limit  string
	Force  string
}

SeasonalGamesOptions - Are the options to hit the seasonal games endpoint

type SeasonalPlayerGamelogsOptions

type SeasonalPlayerGamelogsOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Format  string

	// Optional URL Params
	Team     string
	Player   string
	Position string
	Game     string
	Date     string
	Stats    string
	Sort     string
	Offset   string
	Limit    string
	Force    string
}

SeasonalPlayerGamelogsOptions - Are the options to hit the seasonal games endpoint

type SeasonalPlayerStatsOptions

type SeasonalPlayerStatsOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Format  string

	// Optional URL Params
	Player   string
	Position string
	Country  string
	Team     string
	Date     string
	Stats    string
	Sort     string
	Offset   string
	Limit    string
	Force    string
}

SeasonalPlayerStatsOptions - Are the options to hit the seasonal player stats endpoint

type SeasonalTeamGamelogsOptions

type SeasonalTeamGamelogsOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Format  string

	// Optional URL Params
	Team   string
	Game   string
	Date   string
	Stats  string
	Sort   string
	Offset string
	Limit  string
	Force  string
}

SeasonalTeamGamelogsOptions - Are the options to hit the seasonal team gamelogs endpoint

type SeasonalTeamStatsOptions

type SeasonalTeamStatsOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Format  string

	// Optional URL Params
	Team   string
	Date   string
	Stats  string
	Sort   string
	Offset string
	Limit  string
	Force  string
}

SeasonalTeamStatsOptions - Are the options to hit the seasonal team stats endpoint

type SeasonalVenuesOptions

type SeasonalVenuesOptions struct {
	// URL Parts
	URL     string
	Version string
	Sport   string
	Season  string
	Format  string

	// Optional URL Params
	Team  string
	Force string
}

SeasonalVenuesOptions - Are the options to hit the seasonal venues endpoint

type Service

type Service struct {
	Config *Config
	Logger *logrus.Entry
}

Service - dependencies for the my sports feed service

func NewService

func NewService(config *Config) *Service

NewService -

func (*Service) CurrentSeason

func (s *Service) CurrentSeason(options *CurrentSeasonOptions) (CurrentSeasonIO, int, error)

CurrentSeason - hits the https://api.mysportsfeeds.com/{version}/pull/{sport}/current_season.{format} endpoint

func (*Service) DailyDfs

func (s *Service) DailyDfs(options *DailyDfsOptions) (DfsIO, int, error)

DailyDfs - hits the https://api.mysportsfeeds.com/{version/pull/{sport}/{season}/date/{date}/dfs.{format} endpoint

func (*Service) DailyStandings

func (s *Service) DailyStandings(options *DailyStandingsOptions) (StandingsIO, int, error)

DailyStandings - hits the https://api.mysportsfeeds.com/{version}/pull/{sport}/{season}/standings.{format} endoint

func (*Service) NewCurrentSeasonOptions

func (s *Service) NewCurrentSeasonOptions() *CurrentSeasonOptions

NewCurrentSeasonOptions - Returns the options with most url parts already set to hit the current season endpoint

func (*Service) NewDailyDfsOptions

func (s *Service) NewDailyDfsOptions() *DailyDfsOptions

NewDailyDfsOptions - Returns the options with most url parts already set to hit the daily DFS endpoint

func (*Service) NewDailyGamesOptions

func (s *Service) NewDailyGamesOptions() *DailyGamesOptions

NewDailyGamesOptions - Returns the options with most url parts already set to hit the daily games endpoint

func (*Service) NewDailyPlayerGamelogsOptions

func (s *Service) NewDailyPlayerGamelogsOptions() *DailyPlayerGamelogsOptions

NewDailyPlayerGamelogsOptions - Returns the options with most url parts already set to hit the seasonal games endpoint

func (*Service) NewDailyStandingsOptions

func (s *Service) NewDailyStandingsOptions() *DailyStandingsOptions

NewDailyStandingsOptions - Returns the options with most url parts already set to hit the daily standings endpoint

func (*Service) NewDailyTeamGamelogsOptions

func (s *Service) NewDailyTeamGamelogsOptions() *DailyTeamGamelogsOptions

NewDailyTeamGamelogsOptions - Returns the options with most url parts already set to hit the seasonal games endpoint

func (*Service) NewFeedUpdatesOptions

func (s *Service) NewFeedUpdatesOptions() *FeedUpdatesOptions

NewFeedUpdatesOptions - Returns the options with most url parts already set to hit the feed updates endpoint

func (*Service) NewGameBoxscoreOptions

func (s *Service) NewGameBoxscoreOptions() *GameBoxscoreOptions

NewGameBoxscoreOptions - Returns the options with most url parts already set to hit the daily games endpoint

func (*Service) NewGameLineupOptions

func (s *Service) NewGameLineupOptions() *GameLineupOptions

NewGameLineupOptions - Returns the options with most url parts already set to hit the game lineup endpoint

func (*Service) NewGamePlayByPlayOptions

func (s *Service) NewGamePlayByPlayOptions() *GamePlayByPlayOptions

NewGamePlayByPlayOptions - Returns the options with most url parts already set to hit the game lineup endpoint

func (*Service) NewPlayerInjuriesOptions

func (s *Service) NewPlayerInjuriesOptions() *PlayerInjuriesOptions

NewPlayerInjuriesOptions - Returns the options with most url parts already set to hit the player injuries endpoint

func (*Service) NewPlayersOptions

func (s *Service) NewPlayersOptions() *PlayersOptions

NewPlayersOptions - Returns the options with most url parts already set to hit the players endpoint

func (*Service) NewSeasonalDfsOptions

func (s *Service) NewSeasonalDfsOptions() *SeasonalDfsOptions

NewSeasonalDfsOptions - Returns the options with most url parts already set to hit the seasonal DFS endpoint

func (*Service) NewSeasonalGamesOptions

func (s *Service) NewSeasonalGamesOptions() *SeasonalGamesOptions

NewSeasonalGamesOptions - Returns the options with most url parts already set to hit the seasonal games endpoint

func (*Service) NewSeasonalPlayerGamelogsOptions

func (s *Service) NewSeasonalPlayerGamelogsOptions() *SeasonalPlayerGamelogsOptions

NewSeasonalPlayerGamelogsOptions - Returns the options with most url parts already set to hit the seasonal games endpoint

func (*Service) NewSeasonalPlayerStatsOptions

func (s *Service) NewSeasonalPlayerStatsOptions() *SeasonalPlayerStatsOptions

NewSeasonalPlayerStatsOptions - Returns the options with most url parts already set to hit the seasonal player stats endpoint

func (*Service) NewSeasonalTeamGamelogsOptions

func (s *Service) NewSeasonalTeamGamelogsOptions() *SeasonalTeamGamelogsOptions

NewSeasonalTeamGamelogsOptions - Returns the options with most url parts already set to hit the seasonal games endpoint

func (*Service) NewSeasonalTeamStatsOptions

func (s *Service) NewSeasonalTeamStatsOptions() *SeasonalTeamStatsOptions

NewSeasonalTeamStatsOptions - Returns the options with most url parts already set to hit the seasonal team stats endpoint

func (*Service) NewSeasonalVenuesOptions

func (s *Service) NewSeasonalVenuesOptions() *SeasonalVenuesOptions

NewSeasonalVenuesOptions - Returns the options with most url parts already set to hit the seasonal venues endpoint

func (*Service) PlayerInjuries

func (s *Service) PlayerInjuries(options *PlayerInjuriesOptions) (PlayerInjuriesIO, int, error)

PlayerInjuries - hits the https://api.mysportsfeeds.com/{version/pull/{sport}/{season}/date/{date}/dfs.{format} endpoint

func (*Service) Players

func (s *Service) Players(options *PlayersOptions) (PlayersIO, int, error)

Players - hits the https://api.mysportsfeeds.com/v2.0/pull/mlb/players.{format} endoint

func (*Service) SeasonalDfs

func (s *Service) SeasonalDfs(options *SeasonalDfsOptions) (DfsIO, int, error)

SeasonalDfs - hits the https://api.mysportsfeeds.com/v2.0/pull/{sport}/{season}/dfs.{format} endpoint

func (*Service) SeasonalGames

func (s *Service) SeasonalGames(options *SeasonalGamesOptions) (GamesIO, int, error)

SeasonalGames - hits the https://api.mysportsfeeds.com/v2.0/pull/mlb/{season}/games.{format} endoint

func (*Service) SeasonalPlayerGamelogs

func (s *Service) SeasonalPlayerGamelogs(options *SeasonalPlayerGamelogsOptions) (GameLogIO, int, error)

SeasonalPlayerGamelogs - hits the https://api.mysportsfeeds.com/v2.0/pull/mlb/{season}/player_gamelogs.{format} endoint

func (*Service) SeasonalTeamGamelogs

func (s *Service) SeasonalTeamGamelogs(options *SeasonalTeamGamelogsOptions) (GameLogIO, int, error)

SeasonalTeamGamelogs - hits the https://api.mysportsfeeds.com/{version}/pull/{sport}/{season}/team_gamelogs.{format} endoint

func (*Service) SeasonalVenues

func (s *Service) SeasonalVenues(options *SeasonalVenuesOptions) (VenuesIO, int, error)

SeasonalVenues - hits the https://api.mysportsfeeds.com/{version}/pull/{season}/{season}/venues.{format} endoint

type SigningTeam

type SigningTeam struct {
	ID           int    `json:"id"`
	Abbreviation string `json:"abbreviation"`
}

type Standings

type Standings struct {
	Wins            *int     `json:"wins"`
	Losses          *int     `json:"losses"`
	WinPct          *float64 `json:"winPct"`
	GamesBack       *float64 `json:"gamesBack"`
	RunsFor         *int     `json:"runsFor"`
	RunsAgainst     *int     `json:"runsAgainst"`
	RunDifferential *float64 `json:"runDifferential"`
}

type StandingsIO

type StandingsIO struct {
	LastUpdatedOn string      `json:"lastUpdatedOn"`
	Teams         *[]Teams    `json:"teams"`
	References    *References `json:"references"`
}

type StatReference

type StatReference struct {
	Category     string `json:"category"`
	FullName     string `json:"fullName"`
	Description  string `json:"description"`
	Abbreviation string `json:"abbreviation"`
	Type         string `json:"type"`
}

type Stats

type Stats struct {
	GamesPlayed   *int           `json:"gamesPlayed"`
	Batting       *Batting       `json:"batting"`
	Pitching      *Pitching      `json:"pitching"`
	Fielding      *Fielding      `json:"fielding"`
	Standings     *Standings     `json:"standings"`
	Miscellaneous *Miscellaneous `json:"miscellaneous"`
}

type StatsHomeAway

type StatsHomeAway struct {
	Away *BoxscoreStats `json:"away"`
	Home *BoxscoreStats `json:"home"`
}

type Team

type Team struct {
	ID           int    `json:"id"`
	Abbreviation string `json:"abbreviation"`
}

type TeamLineup

type TeamLineup struct {
	Team     *Team     `json:"team"`
	Expected *Expected `json:"expected"`
	Actual   *Actual   `json:"actual"`
}

type TeamReference

type TeamReference struct {
	ID                   *int          `json:"id"`
	City                 *string       `json:"city"`
	Name                 *string       `json:"name"`
	Abbreviation         *string       `json:"abbreviation"`
	HomeVenue            *HomeVenue    `json:"homeVenue"`
	TeamColoursHex       []interface{} `json:"teamColoursHex"`
	SocialMediaAccounts  []interface{} `json:"socialMediaAccounts"`
	OfficialLogoImageSrc interface{}   `json:"officialLogoImageSrc"`
}

type TeamStatsTotal

type TeamStatsTotal struct {
	Team  *TeamReference `json:"team"`
	Stats *Stats         `json:"stats"`
}

type TeamStatsTotalsIO

type TeamStatsTotalsIO struct {
	LastUpdatedOn   string            `json:"lastUpdatedOn"`
	TeamStatsTotals *[]TeamStatsTotal `json:"teamStatsTotals"`
}

type Teams

type Teams struct {
	Team           *TeamReference `json:"team"`
	Stats          *Stats         `json:"stats"`
	OverallRank    *Rank          `json:"overallRank"`
	ConferenceRank *Rank          `json:"conferenceRank"`
	DivisionRank   *Rank          `json:"divisionRank"`
	PlayoffRank    *Rank          `json:"playoffRank"`
}

type Venue

type Venue struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type VenueReference

type VenueReference struct {
	ID                    *int          `json:"id"`
	Name                  *string       `json:"name"`
	City                  *string       `json:"city"`
	Country               *string       `json:"country"`
	GeoCoordinates        interface{}   `json:"geoCoordinates"`
	CapacitiesByEventType []interface{} `json:"capacitiesByEventType"`
	PlayingSurface        interface{}   `json:"playingSurface"`
	BaseballDimensions    []interface{} `json:"baseballDimensions"`
	HasRoof               interface{}   `json:"hasRoof"`
	HasRetractableRoof    interface{}   `json:"hasRetractableRoof"`
}

type Venues

type Venues struct {
	Venue    *VenueReference `json:"venue"`
	HomeTeam *TeamReference  `json:"homeTeam"`
}

type VenuesIO

type VenuesIO struct {
	LastUpdatedOn string    `json:"lastUpdatedOn"`
	Venues        *[]Venues `json:"venues"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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