utils

package
v0.0.0-...-9d6ba45 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Teams map[string]int = map[string]int{
	"ARI": 15,
	"ATL": 16,
	"BAL": 2,
	"BOS": 3,
	"CHC": 17,
	"CHW": 4,
	"CIN": 18,
	"CLE": 5,
	"COL": 19,
	"DET": 6,
	"HOU": 21,
	"KCR": 7,
	"LAA": 1,
	"LAD": 22,
	"MIA": 20,
	"MIL": 23,
	"MIN": 8,
	"NYM": 25,
	"NYY": 9,
	"OAK": 10,
	"PHI": 26,
	"PIT": 27,
	"SDP": 29,
	"SEA": 11,
	"SFG": 30,
	"STL": 28,
	"TBR": 12,
	"TEX": 13,
	"TOR": 14,
	"WSN": 24,
}

Functions

func FetchTeamStats

func FetchTeamStats(teamKey string, year string) (DataTable, DataTable, error)

func MustBeInt

func MustBeInt(s string) int

func ReadCSV

func ReadCSV(filename string) ([][]string, error)

func ReadTeamCache

func ReadTeamCache(team string, year string) (DataTable, DataTable, error)

func ValidateTeamKey

func ValidateTeamKey(teamKey string) bool

func WriteCSV

func WriteCSV(data [][]string, filename string) error

writeCSV writes the table data to a CSV file.

func WriteTeamCache

func WriteTeamCache(team string, year string, batDataTable DataTable, fldDataTable DataTable) error

Types

type DataTable

type DataTable struct {
	Headers []string
	Rows    [][]string
}

Jump to

Keyboard shortcuts

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