Documentation ¶
Overview ¶
contests contains database storage actions for contests.
Index ¶
- Variables
- func CreateContest(ctx context.Context, contest *models.Contest) error
- func CreateTeam(ctx context.Context, team *models.Team) error
- func ListTeams(ctx context.Context, filter TeamFilter) (models.TeamList, error)
- func UpdateContest(ctx context.Context, contest *models.Contest) error
- func UpdateTeam(ctx context.Context, team *models.Team) error
- type ContestList
- type ListArgs
- type ListFilter
- type TeamFilter
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAccountInTeam = errors.New("an account was already registered in the contest")
View Source
var ErrShortNameExists = errors.New("the shortname is in use")
ErrShortNameExists is returned when the given shortname already exists.
Functions ¶
func CreateContest ¶
CreateContest persists a contest in the database.
func CreateTeam ¶
CreateTeam persists a team with its members in the database.
func UpdateContest ¶
UpdateContest updates a contest within a transaction.
Types ¶
type ContestList ¶
An ContestList is a slice of contests.
func ListContests ¶
func ListContests(ctx context.Context, args ListArgs, filter ListFilter) (ContestList, error)
ListContests returns a list of contests.
func (ContestList) Latest ¶
func (lists ContestList) Latest() *models.Contest
type ListFilter ¶
type ListFilter struct { // Filter by hostname. HostName string }
A ContestFilter controls the filtering behaviour of ListContests.
type TeamFilter ¶
A TeamFilter controls the filtering behaviour of ListTeams.
Click to show internal directories.
Click to hide internal directories.