Compare commits

...

10 Commits

Author SHA1 Message Date
filifa 4bfec7c12c update name 2025-05-10 13:29:38 -04:00
filifa 7968e0f8cb change type to int 2025-04-08 00:54:15 -04:00
filifa cddcf64dde refactor 2025-04-08 00:52:21 -04:00
filifa d8bc8be4f1 return body in handleUnexpectedClose 2025-04-07 23:25:56 -04:00
filifa 7c18c0a396 bug bashin 2025-04-07 23:12:44 -04:00
filifa de3a09f145 remove git_push script 2025-04-06 23:12:02 -04:00
filifa 4ea313151f update copyright year 2025-04-06 23:06:47 -04:00
filifa 55d69a552e add copyright header 2025-04-06 23:02:50 -04:00
filifa 551b39652b change int32 to int 2025-04-06 22:29:56 -04:00
filifa 003f7b1309 go fmt 2025-04-06 22:14:30 -04:00
81 changed files with 4115 additions and 3164 deletions

View File

@ -1,49 +1,49 @@
# mlblive # mlbstats
mlblive is a CLI tool for retrieving data from Major League Baseball's Stats mlbstats is a CLI tool for retrieving data from Major League Baseball's Stats
API, including efficient retrieval of live game data. Unofficial documentation API, including efficient retrieval of live game data. Unofficial documentation
on the Stats API can be found on the Stats API can be found
[here](https://github.com/toddrob99/MLB-StatsAPI/wiki/Endpoints) (thanks to [here](https://github.com/toddrob99/MLB-StatsAPI/wiki/Endpoints) (thanks to
GitHub user toddrob99 for this resource). GitHub user toddrob99 for this resource).
## Usage ## Usage
mlblive provides sub-commands to query a subset of the Stats API endpoints. As mlbstats provides sub-commands to query a subset of the Stats API endpoints. As
of the time of writing, the sub-commands are: of the time of writing, the sub-commands are:
* `mlblive content` (accesses the `game_content` endpoint) * `mlbstats content` (accesses the `game_content` endpoint)
* `mlblive feed` (accesses the `game` endpoint) * `mlbstats feed` (accesses the `game` endpoint)
* `mlblive schedule` (accesses the `schedule` endpoint) * `mlbstats schedule` (accesses the `schedule` endpoint)
* `mlblive standings` (accesses the `standings` endpoint) * `mlbstats standings` (accesses the `standings` endpoint)
* `mlblive subscribe` (accesses the game WebSocket endpoint) * `mlbstats subscribe` (accesses the game WebSocket endpoint)
Each sub-command outputs the raw JSON response from the API. This can then be Each sub-command outputs the raw JSON response from the API. This can then be
piped into other commands like `jq` for further processing. See [this piped into other commands like `jq` for further processing. See [this
repo](https://scm.dairydemon.net/filifa/mlblive-mastodon-scripts) for examples repo](https://scm.dairydemon.net/filifa/mlbstats-mastodon-scripts) for examples
of how the author use this program for posting live score updates and of how the author uses this program for posting live score updates and
highlights to Mastodon. highlights to Mastodon.
Note that mlblive does not provide sub-commands for every endpoint, or flags Note that mlbstats does not provide sub-commands for every endpoint, or flags
for every parameter of every endpoint. The functionality provided was for every parameter of every endpoint. The functionality provided was
prioritized based on the author's own needs. However, the author has made every prioritized based on the author's own needs. However, the author has made every
effort to make the current functionality's code easy to read, and hopes it will effort to make the current functionality's code easy to read, and hopes it will
be similarly easy for other developers to extend functionality as needed. be similarly easy for other developers to extend functionality as needed.
### subscribe sub-command ### subscribe sub-command
`mlblive subscribe` provides an efficient way to obtain live data on active MLB `mlbstats subscribe` provides an efficient way to obtain live data on active MLB
games. Supply the game's PK (which can be retrieved with `mlblive schedule`) to games. Supply the game's PK (which can be retrieved with `mlbstats schedule`) to
receive updates as they happen, without needing to blindly query the `game` receive updates as they happen, without needing to blindly query the `game`
endpoint. endpoint.
### Example ### Example
Use `mlblive schedule` to get the game PK(s) for today's Reds game: Use `mlbstats schedule` to get the game PK(s) for today's Reds game:
``` ```
mlblive schedule -t cin mlbstats schedule -t cin
``` ```
Optionally, use `jq` to filter this output to *just* the game PK(s): Optionally, use `jq` to filter this output to *just* the game PK(s):
``` ```
mlblive schedule -t cin | jq '.dates[].games[].gamePk' mlbstats schedule -t cin | jq '.dates[].games[].gamePk'
``` ```
Then, pass a PK to get live updates: Then, pass a PK to get live updates:
``` ```
mlblive subscribe -g <gamePk> mlbstats subscribe -g <gamePk>
``` ```
## Disclaimer ## Disclaimer

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// AnalyticsAPIService AnalyticsAPI service // AnalyticsAPIService AnalyticsAPI service
type AnalyticsAPIService service type AnalyticsAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -18,7 +33,6 @@ import (
"net/url" "net/url"
) )
// AttendanceAPIService AttendanceAPI service // AttendanceAPIService AttendanceAPI service
type AttendanceAPIService service type AttendanceAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// AwardsAPIService AwardsAPI service // AwardsAPIService AwardsAPI service
type AwardsAPIService service type AwardsAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// BatTrackingAPIService BatTrackingAPI service // BatTrackingAPIService BatTrackingAPI service
type BatTrackingAPIService service type BatTrackingAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// BiomechanicsAPIService BiomechanicsAPI service // BiomechanicsAPIService BiomechanicsAPI service
type BiomechanicsAPIService service type BiomechanicsAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -18,7 +33,6 @@ import (
"net/url" "net/url"
) )
// BroadcastAPIService BroadcastAPI service // BroadcastAPIService BroadcastAPI service
type BroadcastAPIService service type BroadcastAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// ConferenceAPIService ConferenceAPI service // ConferenceAPIService ConferenceAPI service
type ConferenceAPIService service type ConferenceAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// DivisionAPIService DivisionAPI service // DivisionAPIService DivisionAPI service
type DivisionAPIService service type DivisionAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// DraftAPIService DraftAPI service // DraftAPIService DraftAPI service
type DraftAPIService service type DraftAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// GameAPIService GameAPI service // GameAPIService GameAPI service
type GameAPIService service type GameAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -18,7 +33,6 @@ import (
"net/url" "net/url"
) )
// GamePaceAPIService GamePaceAPI service // GamePaceAPIService GamePaceAPI service
type GamePaceAPIService service type GamePaceAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// HighLowAPIService HighLowAPI service // HighLowAPIService HighLowAPI service
type HighLowAPIService service type HighLowAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// HomerunDerbyAPIService HomerunDerbyAPI service // HomerunDerbyAPIService HomerunDerbyAPI service
type HomerunDerbyAPIService service type HomerunDerbyAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// JobAPIService JobAPI service // JobAPIService JobAPI service
type JobAPIService service type JobAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// LeagueAPIService LeagueAPI service // LeagueAPIService LeagueAPI service
type LeagueAPIService service type LeagueAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -18,7 +33,6 @@ import (
"net/url" "net/url"
) )
// MilestonesAPIService MilestonesAPI service // MilestonesAPIService MilestonesAPI service
type MilestonesAPIService service type MilestonesAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -18,7 +33,6 @@ import (
"net/url" "net/url"
) )
// MiscAPIService MiscAPI service // MiscAPIService MiscAPI service
type MiscAPIService service type MiscAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// PersonAPIService PersonAPI service // PersonAPIService PersonAPI service
type PersonAPIService service type PersonAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -18,7 +33,6 @@ import (
"net/url" "net/url"
) )
// PredictionsAPIService PredictionsAPI service // PredictionsAPIService PredictionsAPI service
type PredictionsAPIService service type PredictionsAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -18,7 +33,6 @@ import (
"net/url" "net/url"
) )
// ReviewsAPIService ReviewsAPI service // ReviewsAPIService ReviewsAPI service
type ReviewsAPIService service type ReviewsAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -18,7 +33,6 @@ import (
"net/url" "net/url"
) )
// ScheduleAPIService ScheduleAPI service // ScheduleAPIService ScheduleAPI service
type ScheduleAPIService service type ScheduleAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// SeasonAPIService SeasonAPI service // SeasonAPIService SeasonAPI service
type SeasonAPIService service type SeasonAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// SkeletalAPIService SkeletalAPI service // SkeletalAPIService SkeletalAPI service
type SkeletalAPIService service type SkeletalAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// SportsAPIService SportsAPI service // SportsAPIService SportsAPI service
type SportsAPIService service type SportsAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// StandingsAPIService StandingsAPI service // StandingsAPIService StandingsAPI service
type StandingsAPIService service type StandingsAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -18,7 +33,6 @@ import (
"net/url" "net/url"
) )
// StatsAPIService StatsAPI service // StatsAPIService StatsAPI service
type StatsAPIService service type StatsAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -18,7 +33,6 @@ import (
"net/url" "net/url"
) )
// StreaksAPIService StreaksAPI service // StreaksAPIService StreaksAPI service
type StreaksAPIService service type StreaksAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// TeamsAPIService TeamsAPI service // TeamsAPIService TeamsAPI service
type TeamsAPIService service type TeamsAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -18,7 +33,6 @@ import (
"net/url" "net/url"
) )
// TransactionsAPIService TransactionsAPI service // TransactionsAPIService TransactionsAPI service
type TransactionsAPIService service type TransactionsAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -18,7 +33,6 @@ import (
"net/url" "net/url"
) )
// UniformsAPIService UniformsAPI service // UniformsAPIService UniformsAPI service
type UniformsAPIService service type UniformsAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// VenuesAPIService VenuesAPI service // VenuesAPIService VenuesAPI service
type VenuesAPIService service type VenuesAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -19,7 +34,6 @@ import (
"strings" "strings"
) )
// WeatherAPIService WeatherAPI service // WeatherAPIService WeatherAPI service
type WeatherAPIService service type WeatherAPIService service

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -31,14 +46,13 @@ import (
"strings" "strings"
"time" "time"
"unicode/utf8" "unicode/utf8"
) )
var ( var (
JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`)
XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`)
queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`)
queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]")
) )
// APIClient manages communication with the Stats API Documentation API v2.0.0 // APIClient manages communication with the Stats API Documentation API v2.0.0
@ -218,7 +232,7 @@ func typeCheckParameter(obj interface{}, expected string, name string) error {
return nil return nil
} }
func parameterValueToString( obj interface{}, key string ) string { func parameterValueToString(obj interface{}, key string) string {
if reflect.TypeOf(obj).Kind() != reflect.Ptr { if reflect.TypeOf(obj).Kind() != reflect.Ptr {
if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok {
return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) return fmt.Sprintf("%v", actualObj.GetActualInstanceValue())
@ -226,11 +240,11 @@ func parameterValueToString( obj interface{}, key string ) string {
return fmt.Sprintf("%v", obj) return fmt.Sprintf("%v", obj)
} }
var param,ok = obj.(MappedNullable) var param, ok = obj.(MappedNullable)
if !ok { if !ok {
return "" return ""
} }
dataMap,err := param.ToMap() dataMap, err := param.ToMap()
if err != nil { if err != nil {
return "" return ""
} }
@ -250,8 +264,8 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri
value = "invalid" value = "invalid"
case reflect.Struct: case reflect.Struct:
if t,ok := obj.(MappedNullable); ok { if t, ok := obj.(MappedNullable); ok {
dataMap,err := t.ToMap() dataMap, err := t.ToMap()
if err != nil { if err != nil {
return return
} }
@ -269,7 +283,7 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri
return return
} }
var lenIndValue = indValue.Len() var lenIndValue = indValue.Len()
for i:=0;i<lenIndValue;i++ { for i := 0; i < lenIndValue; i++ {
var arrayValue = indValue.Index(i) var arrayValue = indValue.Index(i)
var keyPrefixForCollectionType = keyPrefix var keyPrefixForCollectionType = keyPrefix
if style == "deepObject" { if style == "deepObject" {
@ -286,7 +300,7 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri
} }
iter := indValue.MapRange() iter := indValue.MapRange()
for iter.Next() { for iter.Next() {
k,v := iter.Key(), iter.Value() k, v := iter.Key(), iter.Value()
parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType)
} }
return return
@ -317,7 +331,7 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri
switch valuesMap := headerOrQueryParams.(type) { switch valuesMap := headerOrQueryParams.(type) {
case url.Values: case url.Values:
if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" {
valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix) + "," + value) valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value)
} else { } else {
valuesMap.Add(keyPrefix, value) valuesMap.Add(keyPrefix, value)
} }

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.
@ -94,8 +109,7 @@ func NewConfiguration() *Configuration {
Description: "No description provided", Description: "No description provided",
}, },
}, },
OperationServers: map[string]ServerConfigurations{ OperationServers: map[string]ServerConfigurations{},
},
} }
return cfg return cfg
} }

View File

@ -1,57 +0,0 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host=""
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id=""
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id=""
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note=""
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing AnalyticsAPIService Testing AnalyticsAPIService
@ -10,11 +25,11 @@ Testing AnalyticsAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_AnalyticsAPIService(t *testing.T) { func Test_api_AnalyticsAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing AttendanceAPIService Testing AttendanceAPIService
@ -10,11 +25,11 @@ Testing AttendanceAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_AttendanceAPIService(t *testing.T) { func Test_api_AttendanceAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing AwardsAPIService Testing AwardsAPIService
@ -10,11 +25,11 @@ Testing AwardsAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_AwardsAPIService(t *testing.T) { func Test_api_AwardsAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing BatTrackingAPIService Testing BatTrackingAPIService
@ -10,11 +25,11 @@ Testing BatTrackingAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_BatTrackingAPIService(t *testing.T) { func Test_api_BatTrackingAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing BiomechanicsAPIService Testing BiomechanicsAPIService
@ -10,11 +25,11 @@ Testing BiomechanicsAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_BiomechanicsAPIService(t *testing.T) { func Test_api_BiomechanicsAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing BroadcastAPIService Testing BroadcastAPIService
@ -10,11 +25,11 @@ Testing BroadcastAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_BroadcastAPIService(t *testing.T) { func Test_api_BroadcastAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing ConferenceAPIService Testing ConferenceAPIService
@ -10,11 +25,11 @@ Testing ConferenceAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_ConferenceAPIService(t *testing.T) { func Test_api_ConferenceAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing DivisionAPIService Testing DivisionAPIService
@ -10,11 +25,11 @@ Testing DivisionAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_DivisionAPIService(t *testing.T) { func Test_api_DivisionAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing DraftAPIService Testing DraftAPIService
@ -10,11 +25,11 @@ Testing DraftAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_DraftAPIService(t *testing.T) { func Test_api_DraftAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing GamePaceAPIService Testing GamePaceAPIService
@ -10,11 +25,11 @@ Testing GamePaceAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_GamePaceAPIService(t *testing.T) { func Test_api_GamePaceAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing GameAPIService Testing GameAPIService
@ -10,11 +25,11 @@ Testing GameAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_GameAPIService(t *testing.T) { func Test_api_GameAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing HighLowAPIService Testing HighLowAPIService
@ -10,11 +25,11 @@ Testing HighLowAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_HighLowAPIService(t *testing.T) { func Test_api_HighLowAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing HomerunDerbyAPIService Testing HomerunDerbyAPIService
@ -10,11 +25,11 @@ Testing HomerunDerbyAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_HomerunDerbyAPIService(t *testing.T) { func Test_api_HomerunDerbyAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing JobAPIService Testing JobAPIService
@ -10,11 +25,11 @@ Testing JobAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_JobAPIService(t *testing.T) { func Test_api_JobAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing LeagueAPIService Testing LeagueAPIService
@ -10,11 +25,11 @@ Testing LeagueAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_LeagueAPIService(t *testing.T) { func Test_api_LeagueAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing MilestonesAPIService Testing MilestonesAPIService
@ -10,11 +25,11 @@ Testing MilestonesAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_MilestonesAPIService(t *testing.T) { func Test_api_MilestonesAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing MiscAPIService Testing MiscAPIService
@ -10,11 +25,11 @@ Testing MiscAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_MiscAPIService(t *testing.T) { func Test_api_MiscAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing PersonAPIService Testing PersonAPIService
@ -10,11 +25,11 @@ Testing PersonAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_PersonAPIService(t *testing.T) { func Test_api_PersonAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing PredictionsAPIService Testing PredictionsAPIService
@ -10,11 +25,11 @@ Testing PredictionsAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_PredictionsAPIService(t *testing.T) { func Test_api_PredictionsAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing ReviewsAPIService Testing ReviewsAPIService
@ -10,11 +25,11 @@ Testing ReviewsAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_ReviewsAPIService(t *testing.T) { func Test_api_ReviewsAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing ScheduleAPIService Testing ScheduleAPIService
@ -10,11 +25,11 @@ Testing ScheduleAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_ScheduleAPIService(t *testing.T) { func Test_api_ScheduleAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing SeasonAPIService Testing SeasonAPIService
@ -10,11 +25,11 @@ Testing SeasonAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_SeasonAPIService(t *testing.T) { func Test_api_SeasonAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing SkeletalAPIService Testing SkeletalAPIService
@ -10,11 +25,11 @@ Testing SkeletalAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_SkeletalAPIService(t *testing.T) { func Test_api_SkeletalAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing SportsAPIService Testing SportsAPIService
@ -10,11 +25,11 @@ Testing SportsAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_SportsAPIService(t *testing.T) { func Test_api_SportsAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing StandingsAPIService Testing StandingsAPIService
@ -10,11 +25,11 @@ Testing StandingsAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_StandingsAPIService(t *testing.T) { func Test_api_StandingsAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing StatsAPIService Testing StatsAPIService
@ -10,11 +25,11 @@ Testing StatsAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_StatsAPIService(t *testing.T) { func Test_api_StatsAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing StreaksAPIService Testing StreaksAPIService
@ -10,11 +25,11 @@ Testing StreaksAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_StreaksAPIService(t *testing.T) { func Test_api_StreaksAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing TeamsAPIService Testing TeamsAPIService
@ -10,11 +25,11 @@ Testing TeamsAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_TeamsAPIService(t *testing.T) { func Test_api_TeamsAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing TransactionsAPIService Testing TransactionsAPIService
@ -10,11 +25,11 @@ Testing TransactionsAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_TransactionsAPIService(t *testing.T) { func Test_api_TransactionsAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing UniformsAPIService Testing UniformsAPIService
@ -10,11 +25,11 @@ Testing UniformsAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_UniformsAPIService(t *testing.T) { func Test_api_UniformsAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing VenuesAPIService Testing VenuesAPIService
@ -10,11 +25,11 @@ Testing VenuesAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_VenuesAPIService(t *testing.T) { func Test_api_VenuesAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Testing WeatherAPIService Testing WeatherAPIService
@ -10,11 +25,11 @@ Testing WeatherAPIService
package api package api
import ( import (
openapiclient "//"
"context" "context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing" "testing"
openapiclient "//"
) )
func Test_api_WeatherAPIService(t *testing.T) { func Test_api_WeatherAPIService(t *testing.T) {

View File

@ -1,4 +1,19 @@
/* /*
Copyright © 2025 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/>.
*/
/*
Stats API Documentation Stats API Documentation
Official API for Major League Baseball. Official API for Major League Baseball.

View File

@ -1,5 +1,5 @@
/* /*
Copyright © 2024 filifa Copyright © 2024,2025 filifa
This program is free software: you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -35,8 +35,7 @@ var statsAPIConfiguration = &api.Configuration{
Description: "No description provided", Description: "No description provided",
}, },
}, },
OperationServers: map[string]api.ServerConfigurations{ OperationServers: map[string]api.ServerConfigurations{},
},
} }
var statsAPIClient = api.NewAPIClient(statsAPIConfiguration) var statsAPIClient = api.NewAPIClient(statsAPIConfiguration)

View File

@ -1,5 +1,5 @@
/* /*
Copyright © 2024 filifa Copyright © 2024,2025 filifa
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -61,6 +61,6 @@ func init() {
// Cobra supports local flags which will only run when this command // Cobra supports local flags which will only run when this command
// is called directly, e.g.: // is called directly, e.g.:
contentCmd.Flags().Int32VarP(&gamePk, "gamePk", "g", 0, "game PK") contentCmd.Flags().IntVarP(&gamePk, "gamePk", "g", 0, "game PK")
contentCmd.MarkFlagRequired("gamePk") contentCmd.MarkFlagRequired("gamePk")
} }

View File

@ -1,5 +1,5 @@
/* /*
Copyright © 2024 filifa Copyright © 2024,2025 filifa
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -61,6 +61,6 @@ func init() {
// Cobra supports local flags which will only run when this command // Cobra supports local flags which will only run when this command
// is called directly, e.g.: // is called directly, e.g.:
feedCmd.Flags().Int32VarP(&gamePk, "gamePk", "g", 0, "game PK") feedCmd.Flags().IntVarP(&gamePk, "gamePk", "g", 0, "game PK")
feedCmd.MarkFlagRequired("gamePk") feedCmd.MarkFlagRequired("gamePk")
} }

View File

@ -1,5 +1,5 @@
/* /*
Copyright © 2024 filifa Copyright © 2024,2025 filifa
This program is free software: you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -20,7 +20,7 @@ import (
) )
// retrieved from https://statsapi.mlb.com/api/v1/leagues // retrieved from https://statsapi.mlb.com/api/v1/leagues
var leagueIDs = map[string]int32{ var leagueIDs = map[string]int{
"al": 103, "al": 103,
"nl": 104, "nl": 104,
"nn2": 431, "nn2": 431,

View File

@ -23,7 +23,7 @@ import (
// rootCmd represents the base command when called without any subcommands // rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
Use: "mlblive", Use: "mlbstats",
Short: "Command line tools for Major League Baseball's Stats API", Short: "Command line tools for Major League Baseball's Stats API",
Long: `Command line tools for Major League Baseball's Stats API.`, Long: `Command line tools for Major League Baseball's Stats API.`,
} }

View File

@ -1,5 +1,5 @@
/* /*
Copyright © 2024 filifa Copyright © 2024,2025 filifa
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,5 @@
/* /*
Copyright © 2024 filifa Copyright © 2024,2025 filifa
This program is free software: you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -20,7 +20,7 @@ import (
) )
// retrieved from https://statsapi.mlb.com/api/v1/sports // retrieved from https://statsapi.mlb.com/api/v1/sports
var sportIDs = map[string]int32{ var sportIDs = map[string]int{
"mlb": 1, "mlb": 1,
"aaa": 11, "aaa": 11,
"aa": 12, "aa": 12,

View File

@ -1,5 +1,5 @@
/* /*
Copyright © 2024 filifa Copyright © 2024,2025 filifa
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -28,7 +28,7 @@ import (
var league leagueAbbr var league leagueAbbr
func standings(cmd *cobra.Command, args []string) { func standings(cmd *cobra.Command, args []string) {
var leagueIds []int32 var leagueIds []int
leagueIds = append(leagueIds, leagueIDs[string(league)]) leagueIds = append(leagueIds, leagueIDs[string(league)])
req := statsAPIClient.StandingsAPI.Standings1(context.Background(), "regularSeason") req := statsAPIClient.StandingsAPI.Standings1(context.Background(), "regularSeason")

View File

@ -1,5 +1,5 @@
/* /*
Copyright © 2024 filifa Copyright © 2024,2025 filifa
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -30,7 +30,21 @@ import (
"scm.dairydemon.net/filifa/mlbstats/api" "scm.dairydemon.net/filifa/mlbstats/api"
) )
var gamePk int32 var gamePk int
func extractTimestamp(body []byte) (any, error) {
var v any
err := json.Unmarshal(body, &v)
if err != nil {
return nil, err
}
vobj := v.(map[string]any)
metaData := vobj["metaData"].(map[string]any)
timestamp := metaData["timeStamp"]
return timestamp, nil
}
func extractPatches(resp []byte) ([]jsonpatch.Patch, error) { func extractPatches(resp []byte) ([]jsonpatch.Patch, error) {
var patches []jsonpatch.Patch var patches []jsonpatch.Patch
@ -46,49 +60,48 @@ func extractPatches(resp []byte) ([]jsonpatch.Patch, error) {
patches = append(patches, patch) patches = append(patches, patch)
} }
return patches, err return patches, nil
} }
func patch(body []byte, client *api.APIClient) error { func requestPatches(timestamp any, client *api.APIClient) ([]jsonpatch.Patch, error) {
var v any
err := json.Unmarshal(body, &v)
if err != nil {
return err
}
vobj := v.(map[string]any)
metaData := vobj["metaData"].(map[string]any)
timestamp := metaData["timeStamp"]
req := client.GameAPI.LiveGameDiffPatchV1(context.Background(), gamePk) req := client.GameAPI.LiveGameDiffPatchV1(context.Background(), gamePk)
req.StartTimecode(timestamp) req = req.StartTimecode(timestamp)
resp, err := req.Execute() resp, err := req.Execute()
if err != nil { if err != nil {
return err return nil, err
} }
diffPatch, err := io.ReadAll(resp.Body) diffPatch, err := io.ReadAll(resp.Body)
if err != nil { if err != nil {
return err return nil, err
} }
patches, err := extractPatches(diffPatch) return extractPatches(diffPatch)
}
func patch(body []byte, client *api.APIClient) ([]byte, error) {
timestamp, err := extractTimestamp(body)
if err != nil { if err != nil {
return err return body, err
}
patches, err := requestPatches(timestamp, client)
if err != nil {
return body, err
} }
for _, patch := range patches { for _, patch := range patches {
body, err = patch.Apply(body) body, err = patch.Apply(body)
if err != nil { if err != nil {
return err return body, err
} }
} }
return err return body, nil
} }
func newWebsocket(gamePk int32) (*gamedayWebsocket, <-chan error, error) { func newWebsocket(gamePk int) (*gamedayWebsocket, <-chan error, error) {
ws, err := newGamedayWebsocket(gamePk) ws, err := newGamedayWebsocket(gamePk)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
@ -97,57 +110,59 @@ func newWebsocket(gamePk int32) (*gamedayWebsocket, <-chan error, error) {
ch := make(chan error) ch := make(chan error)
go ws.keepAlive(10*time.Second, ch) go ws.keepAlive(10*time.Second, ch)
return ws, ch, err return ws, ch, nil
} }
func handleUnexpectedClose(body []byte, client *api.APIClient) (*gamedayWebsocket, error) { func handleUnexpectedClose(client *api.APIClient) ([]byte, *gamedayWebsocket, error) {
ws, _, err := newWebsocket(gamePk) ws, _, err := newWebsocket(gamePk)
if err != nil { if err != nil {
return nil, err return nil, nil, err
} }
req := client.GameAPI.LiveGameV1(context.Background(), gamePk) req := client.GameAPI.LiveGameV1(context.Background(), gamePk)
resp, err := req.Execute() resp, err := req.Execute()
if err != nil { if err != nil {
return ws, err return nil, ws, err
} }
body, err = io.ReadAll(resp.Body) body, err := io.ReadAll(resp.Body)
return ws, err return body, ws, err
} }
func updateFeed(body []byte, ws *gamedayWebsocket, client *api.APIClient) error { func handlePush(ws *gamedayWebsocket, client *api.APIClient) ([]byte, error) {
var p push var p push
err := ws.ReadJSON(&p) err := ws.ReadJSON(&p)
if websocket.IsUnexpectedCloseError(err, GameFinalCode, GameUnavailableCode) { if websocket.IsUnexpectedCloseError(err, GameFinalCode, GameUnavailableCode) {
log.Println(err) log.Println(err)
newWs, err := handleUnexpectedClose(body, client) body, newWs, err := handleUnexpectedClose(client)
if err != nil { if err != nil {
return err return body, err
} }
*ws = *newWs *ws = *newWs
return err return body, nil
} else if err != nil {
return err
} }
err = patch(body, client) return nil, err
}
func updateFeed(body []byte, client *api.APIClient) ([]byte, error) {
body, err := patch(body, client)
if err != nil { if err != nil {
req := client.GameAPI.LiveGameV1(context.Background(), gamePk) req := client.GameAPI.LiveGameV1(context.Background(), gamePk)
resp, err := req.Execute() resp, err := req.Execute()
if err != nil { if err != nil {
return err return body, err
} }
body, err = io.ReadAll(resp.Body) body, err = io.ReadAll(resp.Body)
if err != nil { if err != nil {
return err return body, err
} }
} }
return err return body, nil
} }
func subscribe(cmd *cobra.Command, args []string) { func subscribe(cmd *cobra.Command, args []string) {
@ -164,15 +179,23 @@ func subscribe(cmd *cobra.Command, args []string) {
log.Fatal(err) log.Fatal(err)
} }
for {
body, err := io.ReadAll(resp.Body) body, err := io.ReadAll(resp.Body)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
for {
fmt.Println(string(body)) fmt.Println(string(body))
err = updateFeed(body, ws, statsAPIClient) newBody, err := handlePush(ws, statsAPIClient)
if err != nil {
log.Fatal(err)
} else if newBody != nil {
body = newBody
continue
}
body, err = updateFeed(body, statsAPIClient)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@ -202,6 +225,6 @@ func init() {
// Cobra supports local flags which will only run when this command // Cobra supports local flags which will only run when this command
// is called directly, e.g.: // is called directly, e.g.:
subscribeCmd.Flags().Int32VarP(&gamePk, "gamePk", "g", 0, "game PK") subscribeCmd.Flags().IntVarP(&gamePk, "gamePk", "g", 0, "game PK")
subscribeCmd.MarkFlagRequired("gamePk") subscribeCmd.MarkFlagRequired("gamePk")
} }

View File

@ -1,5 +1,5 @@
/* /*
Copyright © 2024 filifa Copyright © 2024,2025 filifa
This program is free software: you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -20,7 +20,7 @@ import (
) )
// retrieved from https://statsapi.mlb.com/api/v1/teams // retrieved from https://statsapi.mlb.com/api/v1/teams
var teamIDs = map[string]int32{ var teamIDs = map[string]int{
"laa": 108, "laa": 108,
"az": 109, "az": 109,
"bal": 110, "bal": 110,

View File

@ -1,5 +1,5 @@
/* /*
Copyright © 2024 filifa Copyright © 2024,2025 filifa
This program is free software: you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -43,7 +43,7 @@ type gamedayWebsocket struct {
// NewGamedayWebsocket creates a statsapi.GamedayWebsocket using the Stats API // NewGamedayWebsocket creates a statsapi.GamedayWebsocket using the Stats API
// websocket URL and establishes a connection. // websocket URL and establishes a connection.
func newGamedayWebsocket(gamePk int32) (*gamedayWebsocket, error) { func newGamedayWebsocket(gamePk int) (*gamedayWebsocket, error) {
ws := gamedayWebsocket{ ws := gamedayWebsocket{
baseURL: url.URL{ baseURL: url.URL{
Scheme: "wss", Scheme: "wss",
@ -55,9 +55,9 @@ func newGamedayWebsocket(gamePk int32) (*gamedayWebsocket, error) {
return &ws, err return &ws, err
} }
func (g *gamedayWebsocket) init(gamePk int32) error { func (g *gamedayWebsocket) init(gamePk int) error {
endpoint := url.URL{ endpoint := url.URL{
Path: "api/v1/game/push/subscribe/gameday/" + strconv.Itoa(int(gamePk)), Path: "api/v1/game/push/subscribe/gameday/" + strconv.Itoa(gamePk),
} }
url := g.baseURL.ResolveReference(&endpoint) url := g.baseURL.ResolveReference(&endpoint)