Documentation ¶
Index ¶
- func BatchInsertGame(ctx context.Context, conn PGXDB, arr []*Game) (int64, error)
- func BatchInsertGlUpload(ctx context.Context, conn PGXDB, arr []*GlUpload) (int64, error)
- func BatchInsertPitch(ctx context.Context, conn PGXDB, arr []*Pitch) (int64, error)
- func BatchInsertPitchSpatial(ctx context.Context, conn PGXDB, arr []*PitchSpatial) (int64, error)
- func BatchInsertPlay(ctx context.Context, conn PGXDB, arr []*Play) (int64, error)
- func BatchInsertPlayer(ctx context.Context, conn PGXDB, arr []*Player) (int64, error)
- func InsertGame(ctx context.Context, conn PGXDB, arr ...*Game) (int64, error)
- func InsertGlUpload(ctx context.Context, conn PGXDB, arr ...*GlUpload) (int64, error)
- func InsertPitch(ctx context.Context, conn PGXDB, arr ...*Pitch) (int64, error)
- func InsertPitchSpatial(ctx context.Context, conn PGXDB, arr ...*PitchSpatial) (int64, error)
- func InsertPlay(ctx context.Context, conn PGXDB, arr ...*Play) (int64, error)
- func InsertPlayer(ctx context.Context, conn PGXDB, arr ...*Player) (int64, error)
- func Print(w io.Writer, arr []*Play) error
- type Game
- type GlUpload
- type PGXDB
- type Pitch
- func PitchByGameID(ctx context.Context, conn PGXDB, gameID int) ([]*Pitch, error)
- func PitchByGameIDPlayID(ctx context.Context, conn PGXDB, gameID int, playID uuid.UUID) (*Pitch, error)
- func PitchByPitchType(ctx context.Context, conn PGXDB, pitchType *string) ([]*Pitch, error)
- func PitchByPitcherID(ctx context.Context, conn PGXDB, pitcherID int) ([]*Pitch, error)
- func PitchByPitcherIDBatSide(ctx context.Context, conn PGXDB, pitcherID int, batSide string) ([]*Pitch, error)
- func PitchByPitcherIDPitchType(ctx context.Context, conn PGXDB, pitcherID int, pitchType *string) ([]*Pitch, error)
- func PitchByPitcherIDPitchTypeBatSide(ctx context.Context, conn PGXDB, pitcherID int, pitchType *string, ...) ([]*Pitch, error)
- func PitchBySeason(ctx context.Context, conn PGXDB, season int) ([]*Pitch, error)
- func PitchBySeasonPitcherIDPitchType(ctx context.Context, conn PGXDB, season int, pitcherID int, pitchType *string) ([]*Pitch, error)
- func PitchBySeasonPitcherIDPitchTypeBatSide(ctx context.Context, conn PGXDB, season int, pitcherID int, pitchType *string, ...) ([]*Pitch, error)
- type PitchSpatial
- func PitchSpatialByGameIDPlayID(ctx context.Context, conn PGXDB, gameID int, playID uuid.UUID) ([]*PitchSpatial, error)
- func PitchSpatialByGameIDPlayIDTag(ctx context.Context, conn PGXDB, gameID int, playID uuid.UUID, tag *string) (*PitchSpatial, error)
- func PitchSpatialByL01(ctx context.Context, conn PGXDB, l01 int8) ([]*PitchSpatial, error)
- func PitchSpatialByL01L02L03L04(ctx context.Context, conn PGXDB, l01 int8, l02 int8, l03 int8, l04 int8) ([]*PitchSpatial, error)
- func PitchSpatialByL01L02L03L04L05L06L07L08L09(ctx context.Context, conn PGXDB, l01 int8, l02 int8, l03 int8, l04 int8, ...) ([]*PitchSpatial, error)
- func PitchSpatialByL02(ctx context.Context, conn PGXDB, l02 int8) ([]*PitchSpatial, error)
- func PitchSpatialByL03(ctx context.Context, conn PGXDB, l03 int8) ([]*PitchSpatial, error)
- func PitchSpatialByL04(ctx context.Context, conn PGXDB, l04 int8) ([]*PitchSpatial, error)
- func PitchSpatialByL05(ctx context.Context, conn PGXDB, l05 int8) ([]*PitchSpatial, error)
- func PitchToSpatialPitch(m *geom.Coord3, pitch *Pitch) []*PitchSpatial
- func XYZTToSpatialPitch(m *geom.Coord3, gameID int, playID uuid.UUID, xyzt []float64, system string, ...) *PitchSpatial
- type Play
- type PlayResultType
- type PlayType
- type Player
- type RunnerMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchInsertGame ¶
func BatchInsertGlUpload ¶
func BatchInsertPitch ¶
func BatchInsertPitchSpatial ¶
func BatchInsertPlay ¶
func BatchInsertPlayer ¶
func InsertGlUpload ¶
func InsertPitchSpatial ¶
func InsertPlayer ¶
Types ¶
type Game ¶
type GlUpload ¶
type PGXDB ¶
type PGXDB interface { Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error) Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults }
type Pitch ¶
type Pitch struct { Season int `db:"season"` GameID int `db:"game_id"` PlayID uuid.UUID `db:"play_id"` PitcherID int `db:"pitcher_id"` PitchHand string `db:"pitch_hand"` BatterID int `db:"batter_id"` BatSide string `db:"bat_side"` PfxX []float64 `db:"pfx_x"` PfxY []float64 `db:"pfx_y"` PfxZ []float64 `db:"pfx_z"` PitchType *string `db:"pitch_type"` PlateXyzt []float64 `db:"plate_xyzt"` CommitXyzt []float64 `db:"commit_xyzt"` }
func PitchByGameID ¶
func PitchByGameIDPlayID ¶
func PitchByPitchType ¶
func PitchByPitcherID ¶
func PitchByPitcherIDBatSide ¶
func PitchBySeason ¶
type PitchSpatial ¶
type PitchSpatial struct { GameID int `db:"game_id"` PlayID uuid.UUID `db:"play_id"` T float64 `db:"t"` Xyz []float64 `db:"xyz"` M string `db:"m"` MXyz int64 `db:"m_xyz"` MX int `db:"m_x"` MY int `db:"m_y"` MZ int `db:"m_z"` L01 int8 `db:"l01"` L02 int8 `db:"l02"` L03 int8 `db:"l03"` L04 int8 `db:"l04"` L05 int8 `db:"l05"` L06 int8 `db:"l06"` L07 int8 `db:"l07"` L08 int8 `db:"l08"` L09 int8 `db:"l09"` L10 int8 `db:"l10"` L11 int8 `db:"l11"` L12 int8 `db:"l12"` L13 int8 `db:"l13"` L14 int8 `db:"l14"` L15 int8 `db:"l15"` L16 int8 `db:"l16"` Tag *string `db:"tag"` }
func PitchSpatialByL01 ¶
func PitchSpatialByL02 ¶
func PitchSpatialByL03 ¶
func PitchSpatialByL04 ¶
func PitchSpatialByL05 ¶
func PitchToSpatialPitch ¶
func PitchToSpatialPitch(m *geom.Coord3, pitch *Pitch) []*PitchSpatial
type Play ¶
type Play struct { GameID int `db:"game_id"` PlayID uuid.UUID `db:"play_id"` VenueID int `db:"venue_id"` GameIdx int `db:"game_idx"` AtBatIdx int `db:"at_bat_idx"` PlayIdx int `db:"play_idx"` StartTime *time.Time `db:"start_time"` EndTime *time.Time `db:"end_time"` Inning int `db:"inning"` Matchup []int `db:"matchup"` PreScore []int `db:"pre_score"` Score []int `db:"score"` PreRunner RunnerMap `db:"pre_runner"` Runner RunnerMap `db:"runner"` PreCount []int `db:"pre_count"` Count []int `db:"count"` PlayType PlayType `db:"play_type"` PlayResultType PlayResultType `db:"play_result_type"` }
type PlayResultType ¶
type PlayResultType int
const ( PlayResultTypeUnknown PlayResultType = iota // err-unknown PlayResultTypeMissing // err-missing PlayResultTypeBalk // balk PlayResultTypeCaughtStealing // caught-stealing PlayResultTypeDefensiveIndifference // defensive-inference PlayResultTypeDefensiveSubstitution // defensive-substitution PlayResultTypeDefensiveSwitch // defensive-switch PlayResultTypeEjection // ejection PlayResultTypeError // error PlayResultTypeGameAdvisory // advisory PlayResultTypeInjury // injury PlayResultTypeOffensiveSubstitution // offensive-substitution PlayResultTypeOtherAdvance // other-advance PlayResultTypeOtherOut // other-out PlayResultTypePassedBall // passed-ball PlayResultTypePickoffAttempt // pickoff-attempt PlayResultTypePickoffCaught // pickoff-caught PlayResultTypePickoffError // pickoff-error PlayResultTypePitcherSwitch // pitcher-switch PlayResultTypePitcherSubstitution // pitcher-substitution PlayResultTypeStolenBase // stolen-base PlayResultTypeUmpireSubstitution // umpire-substitution PlayResultTypeWildPitch // wild-pitch PlayResultTypePitchCalledStrike // pitch-called-strike PlayResultTypePitchSwingingStrike // pitch-swinging-strike PlayResultTypePitchCalledBall // pitch-called-ball PlayResultTypePitchFoul // pitch-foul PlayResultTypePitchHitBatter // pitch-hit-by-pitch PlayResultTypeInPlayWithOuts // inplay-with-outs PlayResultTypeInPlayNoOuts // inplay-no-outs PlayResultTypeInPlayWithRuns // inplay-with-runs )
func (PlayResultType) MarshalJSON ¶
func (t PlayResultType) MarshalJSON() ([]byte, error)
func (PlayResultType) String ¶
func (i PlayResultType) String() string
type Player ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.