Documentation
¶
Index ¶
- func AddTeamToDatabase(db *sql.DB, team enum.Team, rl *readline.Instance) error
- func CheckTeamScores(db *sql.DB) error
- func CreateDatabase(cfg enum.DatabaseConfig, newlogger *logging.Logger) error
- func EditTeam(id int, newName string, db *sql.DB) error
- func GenerateReport(db *sql.DB) error
- func GetAllTeams(db *sql.DB) ([]enum.ScoringTeam, error)
- func GetTeamServices(db *sql.DB, teamID int) ([]enum.ScoringService, error)
- func SetupSchema(cfg enum.DatabaseConfig, schemaFilePath string) error
- func UpdateServiceScore(db *sql.DB, teamID int, serviceID int, award int, status bool) error
- func ValidateServiceUptime(db *sql.DB) error
- func ViewTeams(db *sql.DB) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTeamToDatabase ¶
Adds a team to the database, returns any errors
func CheckTeamScores ¶
CheckTeamScores queries the database for each team's total score and prints the results.
func CreateDatabase ¶
func CreateDatabase(cfg enum.DatabaseConfig, newlogger *logging.Logger) error
CreateDatabase checks for and creates the "scoring" database if it doesn't exist.
func GenerateReport ¶
GenerateReport connects to the database using the provided configuration, queries the team scores, builds a report struct, and outputs it in YAML format, as Logs/report.yaml
func GetAllTeams ¶
func GetAllTeams(db *sql.DB) ([]enum.ScoringTeam, error)
Gets every team in the database and returns it as an array of teams
func GetTeamServices ¶
Gets a team's services from the SQL database
func SetupSchema ¶
func SetupSchema(cfg enum.DatabaseConfig, schemaFilePath string) error
SetupSchema connects to the "scoring" database and sets up the tables.
func UpdateServiceScore ¶
UpdateServiceScore updates the score a team has for a certain service, as well as its status (up/down)
func ValidateServiceUptime ¶
ValidateServiceUptime checks the current status of services associated with teams.
Types ¶
This section is empty.