xsuportal

package module
v0.0.0-...-9b43f02 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebpushVAPIDPrivateKeyPath = "../vapid_private.pem"
	WebpushSubject             = "xsuportal@example.com"
)

Variables

This section is empty.

Functions

func GetDB

func GetDB() (*sqlx.DB, error)

Types

type BenchmarkJob

type BenchmarkJob struct {
	ID             int64          `db:"id"`
	TeamID         int64          `db:"team_id"`
	Status         int            `db:"status"`
	TargetHostName string         `db:"target_hostname"`
	Handle         sql.NullString `db:"handle"`
	ScoreRaw       sql.NullInt32  `db:"score_raw"`
	ScoreDeduction sql.NullInt32  `db:"score_deduction"`
	Reason         sql.NullString `db:"reason"`
	Passed         sql.NullBool   `db:"passed"`
	StartedAt      sql.NullTime   `db:"started_at"`
	FinishedAt     sql.NullTime   `db:"finished_at"`
	CreatedAt      time.Time      `db:"created_at"`
	UpdatedAt      time.Time      `db:"updated_at"`
}

type Clarification

type Clarification struct {
	ID         int64          `db:"id"`
	TeamID     int64          `db:"team_id"`
	Disclosed  sql.NullBool   `db:"disclosed"`
	Question   sql.NullString `db:"question"`
	Answer     sql.NullString `db:"answer"`
	AnsweredAt sql.NullTime   `db:"answered_at"`
	CreatedAt  time.Time      `db:"created_at"`
	UpdatedAt  time.Time      `db:"updated_at"`
}

type ContestStatus

type ContestStatus struct {
	RegistrationOpenAt time.Time `db:"registration_open_at"`
	ContestStartsAt    time.Time `db:"contest_starts_at"`
	ContestFreezesAt   time.Time `db:"contest_freezes_at"`
	ContestEndsAt      time.Time `db:"contest_ends_at"`
	CurrentTime        time.Time `db:"current_time"`
	StatusStr          string    `db:"status"`
	Frozen             bool      `db:"frozen"`

	Status resources.Contest_Status `db:"-"`
}

type Contestant

type Contestant struct {
	ID        string         `db:"id"`
	Password  string         `db:"password"`
	TeamID    sql.NullInt64  `db:"team_id"`
	Name      sql.NullString `db:"name"`
	Student   bool           `db:"student"`
	Staff     bool           `db:"staff"`
	CreatedAt time.Time      `db:"created_at"`
}

type JobResult

type JobResult struct {
	TeamID     int64     `db:"team_id"`
	Score      int64     `db:"score"`
	StartedAt  time.Time `db:"started_at"`
	FinishedAt time.Time `db:"finished_at"`
}

type LeaderBoardTeam

type LeaderBoardTeam struct {
	ID                   int64          `db:"id"`
	Name                 string         `db:"name"`
	LeaderID             sql.NullString `db:"leader_id"`
	Withdrawn            bool           `db:"withdrawn"`
	Student              sql.NullBool   `db:"student"`
	BestScore            sql.NullInt64  `db:"best_score"`
	BestScoreStartedAt   sql.NullTime   `db:"best_score_started_at"`
	BestScoreMarkedAt    sql.NullTime   `db:"best_score_marked_at"`
	LatestScore          sql.NullInt64  `db:"latest_score"`
	LatestScoreStartedAt sql.NullTime   `db:"latest_score_started_at"`
	LatestScoreMarkedAt  sql.NullTime   `db:"latest_score_marked_at"`
	FinishCount          sql.NullInt64  `db:"finish_count"`
}

func (*LeaderBoardTeam) Team

func (t *LeaderBoardTeam) Team() *Team

type Notification

type Notification struct {
	ID             int64     `db:"id"`
	ContestantID   string    `db:"contestant_id"`
	Read           bool      `db:"read"`
	EncodedMessage string    `db:"encoded_message"`
	CreatedAt      time.Time `db:"created_at"`
	UpdatedAt      time.Time `db:"updated_at"`
}

type Notifier

type Notifier struct {
	// contains filtered or unexported fields
}

func (*Notifier) NotifyBenchmarkJobFinished

func (n *Notifier) NotifyBenchmarkJobFinished(db sqlx.Ext, job *BenchmarkJob) error

func (*Notifier) NotifyClarificationAnswered

func (n *Notifier) NotifyClarificationAnswered(db sqlx.Ext, c *Clarification, updated bool) error

func (*Notifier) VAPIDKey

func (n *Notifier) VAPIDKey() *webpush.Options

type PushSubscription

type PushSubscription struct {
	ID           int64     `db:"id"`
	ContestantID string    `db:"contestant_id"`
	Endpoint     string    `db:"endpoint"`
	P256DH       string    `db:"p256dh"`
	Auth         string    `db:"auth"`
	CreatedAt    time.Time `db:"created_at"`
	UpdatedAt    time.Time `db:"updated_at"`
}

type Team

type Team struct {
	ID           int64          `db:"id"`
	Name         string         `db:"name"`
	LeaderID     sql.NullString `db:"leader_id"`
	EmailAddress string         `db:"email_address"`
	InviteToken  string         `db:"invite_token"`
	Withdrawn    bool           `db:"withdrawn"`
	CreatedAt    time.Time      `db:"created_at"`
	Student      sql.NullBool   `db:"-"`
}

Directories

Path Synopsis
cmd
proto
google/protobuf
Package timestamppb contains generated types for google/protobuf/timestamp.proto.
Package timestamppb contains generated types for google/protobuf/timestamp.proto.

Jump to

Keyboard shortcuts

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