Documentation ¶
Index ¶
- func Logger(srcLog *slog.Logger, o Options) logger.Interface
- type Contest
- type DB
- func (d *DB) Close()
- func (d *DB) CreateContest(ctx context.Context, info scheduler.ContestInfo, data scheduler.ContestData) error
- func (d *DB) CreateInviteLink(ctx context.Context, link userauth.InviteLink) error
- func (d *DB) CreateRoom(ctx context.Context, info roomkeeper.RoomInfo) error
- func (d *DB) CreateRoomToken(ctx context.Context, token userauth.RoomToken) error
- func (d *DB) CreateRunningJob(ctx context.Context, job *scheduler.RunningJob) error
- func (d *DB) CreateUser(ctx context.Context, user userauth.User, link userauth.InviteLink) error
- func (d *DB) DeleteInviteLink(ctx context.Context, linkHash string, userID string) error
- func (d *DB) DeleteRoomToken(ctx context.Context, tokenHash string, userID string) error
- func (d *DB) FinishRunningJob(ctx context.Context, data *scheduler.ContestData, job *scheduler.FinishedJob) error
- func (d *DB) GetContest(ctx context.Context, contestID string) (scheduler.ContestInfo, scheduler.ContestData, error)
- func (d *DB) GetInviteLink(ctx context.Context, linkHash string, now timeutil.UTCTime) (userauth.InviteLink, error)
- func (d *DB) GetRoomToken(ctx context.Context, hash string) (userauth.RoomToken, error)
- func (d *DB) GetUser(ctx context.Context, userID string, o ...userauth.GetUserOptions) (userauth.User, error)
- func (d *DB) GetUserByUsername(ctx context.Context, username string, o ...userauth.GetUserOptions) (userauth.User, error)
- func (d *DB) HasOwnerUser(ctx context.Context) (bool, error)
- func (d *DB) ListActiveRooms(ctx context.Context) ([]roomkeeper.RoomFullData, error)
- func (d *DB) ListContestSucceededJobs(ctx context.Context, contestID string) ([]scheduler.FinishedJob, error)
- func (d *DB) ListContests(ctx context.Context) ([]scheduler.ContestFullData, error)
- func (d *DB) ListRunningContestsFull(ctx context.Context) ([]scheduler.ContestFullData, error)
- func (d *DB) ListRunningJobs(ctx context.Context) ([]scheduler.RunningJob, error)
- func (d *DB) ListUsers(ctx context.Context) ([]userauth.User, error)
- func (d *DB) NewSessionStore(ctx context.Context, opts webui.SessionOptions) sessions.Store
- func (d *DB) PruneInviteLinks(ctx context.Context, now timeutil.UTCTime) error
- func (d *DB) StopRoom(ctx context.Context, roomID string) error
- func (d *DB) UpdateContest(ctx context.Context, contestID string, data scheduler.ContestData) error
- func (d *DB) UpdateRoom(ctx context.Context, roomID string, jobID maybe.Maybe[string]) error
- func (d *DB) UpdateUser(ctx context.Context, user userauth.User, srcO ...userauth.UpdateUserOptions) error
- type FinishedJobData
- type Match
- type Options
- type Room
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Contest ¶
type Contest struct { Info scheduler.ContestInfo `gorm:"embedded"` Data scheduler.ContestData `gorm:"embedded"` RunningJobs []scheduler.RunningJob `gorm:"foreignKey:ContestID"` FinishedJobs []scheduler.FinishedJob `gorm:"foreignKey:ContestID"` Match *Match `gorm:"foreignKey:ID;references:ContestID"` }
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) CreateContest ¶
func (d *DB) CreateContest(ctx context.Context, info scheduler.ContestInfo, data scheduler.ContestData) error
func (*DB) CreateInviteLink ¶
func (*DB) CreateRoom ¶
func (*DB) CreateRoomToken ¶
func (*DB) CreateRunningJob ¶
func (*DB) CreateUser ¶
func (*DB) DeleteInviteLink ¶
func (*DB) DeleteRoomToken ¶
func (*DB) FinishRunningJob ¶
func (d *DB) FinishRunningJob(ctx context.Context, data *scheduler.ContestData, job *scheduler.FinishedJob) error
func (*DB) GetContest ¶
func (d *DB) GetContest(ctx context.Context, contestID string) (scheduler.ContestInfo, scheduler.ContestData, error)
func (*DB) GetInviteLink ¶
func (*DB) GetRoomToken ¶
func (*DB) GetUserByUsername ¶
func (*DB) ListActiveRooms ¶
func (d *DB) ListActiveRooms(ctx context.Context) ([]roomkeeper.RoomFullData, error)
func (*DB) ListContestSucceededJobs ¶
func (*DB) ListContests ¶
func (*DB) ListRunningContestsFull ¶
func (*DB) ListRunningJobs ¶
func (*DB) NewSessionStore ¶
func (*DB) PruneInviteLinks ¶
func (*DB) UpdateContest ¶
func (*DB) UpdateRoom ¶
func (*DB) UpdateUser ¶
type FinishedJobData ¶
type FinishedJobData struct { Status roomkeeper.JobStatus `gorm:"embedded;embeddedPrefix:status_"` PGN *string }
type Match ¶
type Match struct { ContestID string `gorm:"primaryKey"` Settings scheduler.MatchSettings `gorm:"embedded"` Data scheduler.MatchData `gorm:"embedded"` }
type Options ¶
type Options struct { Path string `toml:"path"` Debug bool `toml:"debug"` SlowThreshold time.Duration `toml:"slow-threshold"` BusyTimeout time.Duration `toml:"busy-timeout"` NoUseWAL bool `toml:"no-use-wal"` }
func (*Options) FillDefaults ¶
func (o *Options) FillDefaults()
type Room ¶
type Room struct { Info roomkeeper.RoomInfo `gorm:"embedded"` JobID *string Job *scheduler.RunningJob `gorm:"foreignKey:JobID"` }
Click to show internal directories.
Click to hide internal directories.