The Sports Building Block manages sports data for the Rokwire platform.
The functionality provided by this application is documented in the Wiki.
Go v1.16+
The following Environment variables are supported. The service will not start unless those marked as Required are supplied.
Name | Format | Required | Description |
---|---|---|---|
XML_FEED_FTP_HOST | < url > | yes | The FTP server's host for the XML feed |
XML_FEED_FTP_USER | < string > | yes | The user for the FRP server of the XML feed |
XML_FEED_FTP_PASSWORD | < string > | yes | The user's password for the FTP server of the XML feed |
SS_INTERNAL_API_KEY | < string > | yes | The API-KEY for internal communication with the Notifications BB |
SS_HOST | < url > | yes | Host for the Rokwire services |
SS_CORE_BB_URL | < url > | yes | The base URL for the Core BB |
-
Clone this repo (outside GOPATH)
-
Open the terminal and go to the root folder
cd sports-service
- Make the project
$ make
▶ go mod vendor
▶ Log info…
...
▶ Checking formatting…
▶ running golint…
▶ building executable(s)… 1.0.247 2021-10-12T08:56:56+0300
sport
- Run the executable
./bin/sport
-
Clone the repo (outside GOPATH)
-
Open the terminal and go to the root folder
-
Create Docker image
docker build -t sports-service .
- Run as Docker container
docker run -e ROKWIRE_API_KEYS -e XML_FEED_FTP_HOST -e XML_FEED_FTP_USER -e XML_FEED_FTP_PASSWORD -e FIREBASE_PROJECT_ID -e FIREBASE_AUTH -e SS_FIREBASE_PROJECT_ID_SAFER -e SS_FIREBASE_AUTH_SAFER -e SS_INTERNAL_API_KEY -e SS_HOST -d -p 80:80 sports-service
docker stop $(docker ps -a -q)
make lint
make checkfmt
make fixfmt
make clean
Verify the service is running as calling the get version API.
curl -X GET -i https://api-dev.rokwire.illinois.edu/sports-service/version
Response
2.0.0
Name | Deprecated | Description |
---|---|---|
/sports-service/version | no | get server version |
/sports-service/api/v2/config | no | get/update live games config |
/sports-service/api/v2/sports | no | get sport definitions |
/sports-service/api/v2/news | no | get news |
/sports-service/api/v2/coaches | no | get coaches |
/sports-service/api/v2/players | no | get players |
/sports-service/api/v2/social | no | get social media accounts |
/sports-service/api/v2/games | no | get games |
/sports-service/api/v2/team-schedule | no | get team schedule |
/sports-service/api/v2/team-record | no | get team record |
/sports-service/api/v2/live-games | no | get current live games |
If you would like to contribute to this project, please be sure to read the Contributing Guidelines, Code of Conduct, and Conventions before beginning.
This repository is configured with a pre-commit hook that runs Yelp's Detect Secrets. If you intend to contribute directly to this repository, you must install pre-commit on your local machine to ensure that no secrets are pushed accidentally.
# Install software
$ git pull # Pull in pre-commit configuration & baseline
$ pip install pre-commit
$ pre-commit install