internal

package
v0.0.0-...-8417315 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Log        *zerolog.Logger
	DB         *database.Database
	EmailRegex *regexp.Regexp
	Config     config.Configuration

	ConfirmEmailRenderer       func(w http.ResponseWriter, r *http.Request, extraData map[string]any)
	TeacherLoginRenderer       func(w http.ResponseWriter, r *http.Request, extraData map[string]any)
	EmailLoginRenderer         func(w http.ResponseWriter, r *http.Request, extraData map[string]any)
	StudentConfirmInfoRenderer func(w http.ResponseWriter, r *http.Request, extraData map[string]any)
	TeamAddMemberRenderer      func(w http.ResponseWriter, r *http.Request, extraData map[string]any)

	TeacherCreateAccountRenderer func(w http.ResponseWriter, r *http.Request, extraData map[string]any)

	SendGridClient *sendgrid.Client
}

func NewApplication

func NewApplication(log *zerolog.Logger, db *database.Database) *Application

func (*Application) CreateEmailLoginJWT

func (a *Application) CreateEmailLoginJWT(email string) *jwt.Token

func (*Application) CreateSessionJWT

func (a *Application) CreateSessionJWT(email string) (*jwt.Token, time.Time)

func (*Application) GetAdminDietaryRestrictionsTemplate

func (a *Application) GetAdminDietaryRestrictionsTemplate(r *http.Request) map[string]any

func (*Application) GetAdminTeamsTemplate

func (a *Application) GetAdminTeamsTemplate(r *http.Request) map[string]any

func (*Application) GetArchiveTemplate

func (a *Application) GetArchiveTemplate(*http.Request) map[string]any

func (*Application) GetEmailLoginTemplate

func (a *Application) GetEmailLoginTemplate(r *http.Request) map[string]any

func (*Application) GetLoggedInTeacher

func (a *Application) GetLoggedInTeacher(r *http.Request) (*database.Teacher, error)

func (*Application) GetParentSignFormsTemplate

func (a *Application) GetParentSignFormsTemplate(r *http.Request) map[string]any

func (*Application) GetStudentConfirmInfoTemplate

func (a *Application) GetStudentConfirmInfoTemplate(r *http.Request) map[string]any

func (*Application) GetTeacherAddMemberTemplate

func (a *Application) GetTeacherAddMemberTemplate(r *http.Request) map[string]any

func (*Application) GetTeacherCreateAccountTemplate

func (a *Application) GetTeacherCreateAccountTemplate(r *http.Request) map[string]any

func (*Application) GetTeacherSchoolInfoTemplate

func (a *Application) GetTeacherSchoolInfoTemplate(r *http.Request) map[string]any

func (*Application) GetTeacherTeamEditTemplate

func (a *Application) GetTeacherTeamEditTemplate(r *http.Request) map[string]any

func (*Application) GetTeacherTeamsTemplate

func (a *Application) GetTeacherTeamsTemplate(r *http.Request) map[string]any

func (*Application) GetVolunteerScanTemplate

func (a *Application) GetVolunteerScanTemplate(r *http.Request) map[string]any

func (*Application) HandleAdminEmailLogin

func (a *Application) HandleAdminEmailLogin(w http.ResponseWriter, r *http.Request)

func (*Application) HandleAdminLogin

func (a *Application) HandleAdminLogin(w http.ResponseWriter, r *http.Request)
func (a *Application) HandleGetParentEmailConfirmationLink(w http.ResponseWriter, r *http.Request)
func (a *Application) HandleGetStudentEmailConfirmationLink(w http.ResponseWriter, r *http.Request)

func (*Application) HandleKattisParticipantsExport

func (a *Application) HandleKattisParticipantsExport(w http.ResponseWriter, r *http.Request)

func (*Application) HandleKattisTeamsExport

func (a *Application) HandleKattisTeamsExport(w http.ResponseWriter, r *http.Request)

func (*Application) HandleParentSignForms

func (a *Application) HandleParentSignForms(w http.ResponseWriter, r *http.Request)

func (*Application) HandleResendParentEmail

func (a *Application) HandleResendParentEmail(w http.ResponseWriter, r *http.Request)

func (*Application) HandleResendStudentEmail

func (a *Application) HandleResendStudentEmail(w http.ResponseWriter, r *http.Request)

func (*Application) HandleSendCTFdPassword

func (a *Application) HandleSendCTFdPassword(w http.ResponseWriter, r *http.Request)

func (*Application) HandleSendEmailConfirmationReminders

func (a *Application) HandleSendEmailConfirmationReminders(w http.ResponseWriter, r *http.Request)

func (*Application) HandleSendParentReminders

func (a *Application) HandleSendParentReminders(w http.ResponseWriter, r *http.Request)

func (*Application) HandleSendQRCodes

func (a *Application) HandleSendQRCodes(w http.ResponseWriter, r *http.Request)

func (*Application) HandleStudentConfirmEmail

func (a *Application) HandleStudentConfirmEmail(w http.ResponseWriter, r *http.Request)

func (*Application) HandleTeacherAddMember

func (a *Application) HandleTeacherAddMember(w http.ResponseWriter, r *http.Request)

func (*Application) HandleTeacherCreateAccount

func (a *Application) HandleTeacherCreateAccount(w http.ResponseWriter, r *http.Request)

func (*Application) HandleTeacherDeleteMember

func (a *Application) HandleTeacherDeleteMember(w http.ResponseWriter, r *http.Request)

func (*Application) HandleTeacherEmailLogin

func (a *Application) HandleTeacherEmailLogin(w http.ResponseWriter, r *http.Request)

func (*Application) HandleTeacherLogin

func (a *Application) HandleTeacherLogin(w http.ResponseWriter, r *http.Request)

func (*Application) HandleTeacherLogout

func (a *Application) HandleTeacherLogout(w http.ResponseWriter, r *http.Request)

func (*Application) HandleTeacherSchoolInfo

func (a *Application) HandleTeacherSchoolInfo(w http.ResponseWriter, r *http.Request)

func (*Application) HandleTeacherTeamEdit

func (a *Application) HandleTeacherTeamEdit(w http.ResponseWriter, r *http.Request)

func (*Application) HandleVolunteerCheckIn

func (a *Application) HandleVolunteerCheckIn(w http.ResponseWriter, r *http.Request)

func (*Application) HandleVolunteerEmailLogin

func (a *Application) HandleVolunteerEmailLogin(w http.ResponseWriter, r *http.Request)

func (*Application) HandleVolunteerLogin

func (a *Application) HandleVolunteerLogin(w http.ResponseWriter, r *http.Request)

func (*Application) HandleZoomBreakoutExport

func (a *Application) HandleZoomBreakoutExport(w http.ResponseWriter, r *http.Request)

func (*Application) SendEmail

func (a *Application) SendEmail(log zerolog.Logger, subject string, to *mail.Email, plainTextContent, htmlContent string) error

func (*Application) ServeTemplate

func (a *Application) ServeTemplate(logger *zerolog.Logger, templateName string, generateTemplateData func(r *http.Request) map[string]any) func(w http.ResponseWriter, r *http.Request)

func (*Application) ServeTemplateExtra

func (a *Application) ServeTemplateExtra(logger *zerolog.Logger, templateName string, generateTemplateData func(r *http.Request) map[string]any) func(w http.ResponseWriter, r *http.Request, extraData map[string]any)

func (*Application) Start

func (a *Application) Start()

type CompetitionResult

type CompetitionResult struct {
	Name      string
	Shortname string
	Teams     []WinningTeam
}

type Issuer

type Issuer string
const (
	IssuerEmailLogin     Issuer = "email_login"
	IssuerSessionToken   Issuer = "session_token"
	IssuerStudentVerify  Issuer = "student_verify"
	IssuerSignForms      Issuer = "sign_forms"
	IssuerAdminLogin     Issuer = "admin_login"
	IssuerStudentQRCode  Issuer = "student_qrcode"
	IssuerVolunteerLogin Issuer = "volunteer_login"
)
type Link struct {
	URL   string
	Title string
}

type WinningTeam

type WinningTeam struct {
	Place    string
	Name     string
	School   string
	Location string
}

type YearInfo

type YearInfo struct {
	Year            int
	RecapParagraphs []string
	Links           []Link
	Results         []CompetitionResult
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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