clean out internal some more

This commit is contained in:
filifa 2025-04-06 01:07:57 -04:00
parent 481ae64cc1
commit abdfd503fd
6 changed files with 64 additions and 200 deletions

View File

@ -1,36 +0,0 @@
/*
Copyright © 2024 filifa
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
*/
package statsapi
type LeagueID int
// NOTE: there's a lot more leagues than this, but I don't care enough to put
// them all in right now
const (
AL LeagueID = 103
NL LeagueID = 104
NN2 LeagueID = 431
NNL LeagueID = 430
EWL LeagueID = 429
NAL LeagueID = 428
ECL LeagueID = 427
ANL LeagueID = 426
NSL LeagueID = 432
AA LeagueID = 100
PL LeagueID = 105
UA LeagueID = 101
FL LeagueID = 106
)

View File

@ -1,41 +0,0 @@
/*
Copyright © 2024 filifa
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
*/
package statsapi
type SportID int
// These are all the Sport IDs used in some of the API calls, like the schedule
// endpoint.
const (
MLB SportID = 1
TripleA SportID = 11
DoubleA SportID = 12
HighA SportID = 13
SingleA SportID = 14
Rookie SportID = 16
Winter SportID = 17
MILB SportID = 21
Independent SportID = 23
Negro SportID = 61
Korea SportID = 32
NPB SportID = 31
International SportID = 51
International18U SportID = 509
International16U SportID = 510
InternationalAmateur SportID = 6005
College SportID = 22
HighSchool SportID = 586
)

View File

@ -1,53 +0,0 @@
/*
Copyright © 2024 filifa
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
*/
package statsapi
type TeamID int
// NOTE: there are obviously more teams than this (in other leagues), but I
// only need MLB for my purposes
const (
LAA TeamID = 108
AZ TeamID = 109
BAL TeamID = 110
BOS TeamID = 111
CHC TeamID = 112
CIN TeamID = 113
CLE TeamID = 114
COL TeamID = 115
DET TeamID = 116
HOU TeamID = 117
KC TeamID = 118
LAD TeamID = 119
WSH TeamID = 120
NYM TeamID = 121
OAK TeamID = 133
PIT TeamID = 134
SD TeamID = 135
SEA TeamID = 136
SF TeamID = 137
STL TeamID = 138
TB TeamID = 139
TEX TeamID = 140
TOR TeamID = 141
MIN TeamID = 142
PHI TeamID = 143
ATL TeamID = 144
CWS TeamID = 145
MIA TeamID = 146
NYY TeamID = 147
MIL TeamID = 158
)

View File

@ -17,24 +17,22 @@ package cmd
import ( import (
"strings" "strings"
"scm.dairydemon.net/filifa/mlbstats/cmd/internal/statsapi"
) )
var leagueIDs = map[string]statsapi.LeagueID{ var leagueIDs = map[string]int32{
"al": statsapi.AL, "al": 103,
"nl": statsapi.NL, "nl": 104,
"nn2": statsapi.NN2, "nn2": 431,
"nnl": statsapi.NNL, "nnl": 430,
"ewl": statsapi.EWL, "ewl": 429,
"nal": statsapi.NAL, "nal": 428,
"ecl": statsapi.ECL, "ecl": 427,
"anl": statsapi.ANL, "anl": 426,
"nsl": statsapi.NSL, "nsl": 432,
"aa": statsapi.AA, "aa": 100,
"pl": statsapi.PL, "pl": 105,
"ua": statsapi.UA, "ua": 101,
"fl": statsapi.FL, "fl": 106,
} }
type leagueAbbr string type leagueAbbr string

View File

@ -17,29 +17,27 @@ package cmd
import ( import (
"strings" "strings"
"scm.dairydemon.net/filifa/mlbstats/cmd/internal/statsapi"
) )
var sportIDs = map[string]statsapi.SportID{ var sportIDs = map[string]int32{
"mlb": statsapi.MLB, "mlb": 1,
"aaa": statsapi.TripleA, "aaa": 11,
"aa": statsapi.DoubleA, "aa": 12,
"higha": statsapi.HighA, "higha": 13,
"a": statsapi.SingleA, "a": 14,
"rookie": statsapi.Rookie, "rookie": 16,
"winter": statsapi.Winter, "winter": 17,
"milb": statsapi.MILB, "milb": 21,
"indie": statsapi.Independent, "indie": 23,
"negro": statsapi.Negro, "negro": 61,
"kbo": statsapi.Korea, "kbo": 32,
"npb": statsapi.NPB, "npb": 31,
"int": statsapi.International, "int": 51,
"int18u": statsapi.International18U, "int18u": 509,
"int16u": statsapi.International16U, "int16u": 510,
"intamateur": statsapi.InternationalAmateur, "intamateur": 6005,
"college": statsapi.College, "college": 22,
"hs": statsapi.HighSchool, "hs": 586,
} }
type sportAbbr string type sportAbbr string

View File

@ -17,41 +17,39 @@ package cmd
import ( import (
"strings" "strings"
"scm.dairydemon.net/filifa/mlbstats/cmd/internal/statsapi"
) )
var teamIDs = map[string]statsapi.TeamID{ var teamIDs = map[string]int32{
"laa": statsapi.LAA, "laa": 108,
"az": statsapi.AZ, "az": 109,
"bal": statsapi.BAL, "bal": 110,
"bos": statsapi.BOS, "bos": 111,
"chc": statsapi.CHC, "chc": 112,
"cin": statsapi.CIN, "cin": 113,
"cle": statsapi.CLE, "cle": 114,
"col": statsapi.COL, "col": 115,
"det": statsapi.DET, "det": 116,
"hou": statsapi.HOU, "hou": 117,
"kc": statsapi.KC, "kc": 118,
"lad": statsapi.LAD, "lad": 119,
"wsh": statsapi.WSH, "wsh": 120,
"nym": statsapi.NYM, "nym": 121,
"oak": statsapi.OAK, "oak": 133,
"pit": statsapi.PIT, "pit": 134,
"sd": statsapi.SD, "sd": 135,
"sea": statsapi.SEA, "sea": 136,
"sf": statsapi.SF, "sf": 137,
"stl": statsapi.STL, "stl": 138,
"tb": statsapi.TB, "tb": 139,
"tex": statsapi.TEX, "tex": 140,
"tor": statsapi.TOR, "tor": 141,
"min": statsapi.MIN, "min": 142,
"phi": statsapi.PHI, "phi": 143,
"atl": statsapi.ATL, "atl": 144,
"cws": statsapi.CWS, "cws": 145,
"mia": statsapi.MIA, "mia": 146,
"nyy": statsapi.NYY, "nyy": 147,
"mil": statsapi.MIL, "mil": 158,
} }
type teamAbbr string type teamAbbr string