Documentation ¶
Index ¶
- func AddCategory(db *sql.DB, category *Category) (err error)
- func AddFlag(db *sql.DB, flag *Flag) (err error)
- func AddScore(db *sql.DB, score *Score) (err error)
- func AddSession(db *sql.DB, s *Session) (err error)
- func AddTask(db *sql.DB, t *Task) (err error)
- func AddTeam(db *sql.DB, t *Team) (err error)
- func CleanDatabase(db *sql.DB) (err error)
- func GetSessionCount(db *sql.DB) (count int, err error)
- func GetSessionTeam(db *sql.DB, session string) (teamID int, err error)
- func GetSolvedBy(db *sql.DB, taskID int) (teamIDs []int, err error)
- func GetSolvedCount(db *sql.DB, taskID int) (count int, err error)
- func GetTeamIDByToken(db *sql.DB, token string) (teamID int, err error)
- func InitDatabase(path string) (db *sql.DB, err error)
- func IsSolved(db *sql.DB, teamID, taskID int) (solved bool, err error)
- func OpenDatabase(path string) (db *sql.DB, err error)
- func SetOpened(db *sql.DB, taskID int, opened bool) (err error)
- func UpdateTask(db *sql.DB, t *Task) (err error)
- type Category
- type Flag
- type Score
- type Session
- type Task
- type Team
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCategory ¶
AddCategory add category to db and fill Id
func AddSession ¶
AddSession add session and fill id
func CleanDatabase ¶
CleanDatabase clean all values and restart sequences in database without drop tables
func GetSessionCount ¶
GetSessionCount returns count of logged teams for all time
func GetSessionTeam ¶
GetSessionTeam get team id for session
func GetSolvedBy ¶
GetSolvedBy get all team ids who solved task
func GetSolvedCount ¶
GetSolvedCount return amount of solved flags
func GetTeamIDByToken ¶
GetTeamIDByToken get team id by access token
func InitDatabase ¶
InitDatabase recreate all database tables
func OpenDatabase ¶
OpenDatabase need defer db.Close() after open
Types ¶
Click to show internal directories.
Click to hide internal directories.