database

package
v0.0.0-...-d709508 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTeamToDatabase

func AddTeamToDatabase(db *sql.DB, team enum.Team, rl *readline.Instance) error

Adds a team to the database, returns any errors

func CheckTeamScores

func CheckTeamScores(db *sql.DB) error

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 EditTeam

func EditTeam(id int, newName string, db *sql.DB) error

EditTeam updates the team name for the specified team.

func GenerateReport

func GenerateReport(db *sql.DB) error

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

func GetTeamServices(db *sql.DB, teamID int) ([]enum.ScoringService, error)

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

func UpdateServiceScore(db *sql.DB, teamID int, serviceID int, award int, status bool) error

UpdateServiceScore updates the score a team has for a certain service, as well as its status (up/down)

func ValidateServiceUptime

func ValidateServiceUptime(db *sql.DB) error

ValidateServiceUptime checks the current status of services associated with teams.

func ViewTeams

func ViewTeams(db *sql.DB) error

ViewTeams retrieves and prints all teams from the database.

Types

This section is empty.

Jump to

Keyboard shortcuts

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