controller

package
v0.0.0-...-802508d Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 24 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// File size
	MaxFileSize int64 = 3 << 20 // 3 MB
	CSVFileSize int64 = 1 << 19 // 512 KB
)

Variables

This section is empty.

Functions

func AdminAbstractsZip

func AdminAbstractsZip(c echo.Context) error

AdminAbstractsZip streams every submitted abstract as one zip, grouped into a folder per event, with a README that maps each file back to its team.

@Summary Download all abstracts @Tags Admin @Produce application/zip @Param event query string false "limit to a single event tag" @Success 200 {string} string "application/zip" @Failure 403 {string} Forbidden @Failure 404 {string} NotFound @Router /admin/abstracts.zip [get]

func AdminAddAdmin

func AdminAddAdmin(c echo.Context) error

func AdminAddMember

func AdminAddMember(c echo.Context) error

func AdminDeleteUser

func AdminDeleteUser(c echo.Context) error

func AdminPage

func AdminPage(c echo.Context) error

AdminPage renders the admin panel with every team, person and admin.

@Summary Admin panel @Tags Admin @Produce html @Router /admin [get]

func AdminRemoveAdmin

func AdminRemoveAdmin(c echo.Context) error

func AdminRemoveMember

func AdminRemoveMember(c echo.Context) error

func AdminRenameTeam

func AdminRenameTeam(c echo.Context) error

func AdminRevokeTeam

func AdminRevokeTeam(c echo.Context) error
func AdminSetProjectLinks(c echo.Context) error

AdminSetProjectLinks uses the existing admin session, CSRF header and audit trail to record links received outside the team's form.

@Summary Set final links on behalf of a team @Tags Admin @Accept json @Produce json @Param links body adminProjectDto true "Event, team id and both links" @Success 200 {object} models.ProjectLinksResponse @Router /admin/team/project [post]

func AdminUpdateUser

func AdminUpdateUser(c echo.Context) error

func AllotTeamsToMentor

func AllotTeamsToMentor(c echo.Context) error

AllotTeamsToMentor

@Summary Allot teams to mentor @Schemes @Description Allots the teams to the mentor @Tags CodeSangam @Accept json @Produce json @Param event query string true "event" @Success 200 {string} string @Router /v1/cs/allot [post]

func GetAbstractFile

func GetAbstractFile(c echo.Context) error

GetAbstractFile

@Summary Fetch abstract file from server @Schemes @Description Returns the abstract file @Tags CodeSangam @Accept json @Produce application/pdf @Param id query string true "id" @Success 200 {string} string "application/pdf" @Router /v1/cs/abstract [get]

func GetAllotmentCSV

func GetAllotmentCSV(c echo.Context) error

GetAllotmentCSV

@Summary Fetch allotment csv from server @Schemes @Description Returns the allotment csv @Tags CodeSangam @Accept json @Produce text/csv @Param event query string true "event" @Success 200 {string} string "text/csv" @Router /v1/cs/allot [get]

func GetContriHubRankings

func GetContriHubRankings(c echo.Context) error

GetContriHubRankings

@Summary Fetch rankings from ContriHUB @Schemes @Description Returns the list of ranked users @Tags ContriHUB @Accept json @Produce json @Success 200 {object} []models.ContriHUBUser @Router /v1/contrihub/rankings [get]

func GetEventRanking

func GetEventRanking(c echo.Context) error

GetEventRanking

@Summary Fetch event ranking from database @Schemes @Description Returns the event ranking @Tags CodeSangam @Accept json @Produce json @Param event query string true "event" @Success 200 {object} []models.DashboardTeam @Router /v1/cs/ranking [get]

func GetRegistrationDeadline

func GetRegistrationDeadline(c echo.Context) error

GetRegistrationDeadline

@Summary Registration deadline and development period @Schemes @Description The unix timestamp after which registration and abstract submission close, whether that moment has passed, and the development period. Public on purpose: these dates are not a secret. @Tags CodeSangam @Accept json @Produce json @Success 200 {object} deadlineDto @Router /v1/cs/deadline [get]

func GetUserInfo

func GetUserInfo(c echo.Context) error

GetUserInfo

@Summary Fetch user info from database @Schemes @Description Returns the user info @Tags CodeSangam @Accept json @Produce json @Success 200 {object} models.DashboardUserDto @Router /v1/cs/user [get]

func GoogleCallback

func GoogleCallback(c echo.Context) error

GoogleCallback

@Summary Callback @Schemes @Description Callback @Tags Auth @Accept json @Produce html @Success 302 {object} map[string]string @Failure 401 {string} Unauthorized @Router /auth/callback [get]

func GoogleLogin

func GoogleLogin(c echo.Context) error

GoogleLogin

@Summary Login @Schemes @Description Login @Tags Auth @Accept json @Produce html @Success 302 {object} map[string]string @Failure 401 {string} Unauthorized @Router /auth/login [get]

func GoogleLogout

func GoogleLogout(c echo.Context) error

GoogleLogout

@Summary Logout @Schemes @Description Logout @Tags Auth @Security OAuth2 @Accept json @Produce html @Success 302 {object} map[string]string @Failure 401 {string} Unauthorized @Router /auth/logout [get]

func HelloGO(c echo.Context) error

HelloGO

@Summary GO ping @Schemes @Description Do ping @Tags _ @Accept json @Produce json @Success 200 {object} map[string]string @Router /go [get]

func LoginPage

func LoginPage(c echo.Context) error

LoginPage

@Summary Login page @Schemes @Description Login page @Tags Auth @Accept json @Produce html @Success 200 {object} map[string]string @Router /auth [get]

func ProjectLinksCSV

func ProjectLinksCSV(c echo.Context) error

ProjectLinksCSV includes registered teams without submissions so organizers can see what is missing. Team id, not team name, is the workbook join key.

@Summary Download final submission links @Tags Admin @Produce text/csv @Param event query string false "Optional event tag" @Success 200 {string} string "CSV of teams and final project links" @Failure 403 {string} string "Admins only" @Router /v1/cs/project/links.csv [get]

func RegisterTeam

func RegisterTeam(c echo.Context) error

RegisterTeam

@Summary Register team to database for an event @Schemes @Description Registers the team to the database for an event. Members list should not include the leader. @Tags CodeSangam @Accept json @Produce json @Param team body models.RegisterTeamDto true "Team" @Success 200 {object} models.DashboardTeam @Router /v1/cs/register [post]

func SaveUser

func SaveUser(c echo.Context) error

SaveUser

SaveUser

@Summary Current user profile @Schemes @Description Returns the signed-in user's own profile. It no longer accepts a user in the body: identity and registration number are established at sign-in, so POSTing an email and reg no here would let anyone forge an account. @Tags CodeSangam @Accept json @Produce json @Success 200 {object} models.User @Router /v1/cs/user [post]

func SubmitProjectLinks(c echo.Context) error

SubmitProjectLinks stores the signed-in member's own team's final links. Registration and abstract deadlines deliberately do not apply here; the separate PROJECT_SUBMISSION_CLOSED switch is what closes this form.

@Summary Submit or update final project links @Tags CodeSangam @Accept json @Produce json @Param X-CS-Project header string true "1" @Param links body models.ProjectLinksDto true "Both links are required" @Success 200 {object} models.ProjectLinksResponse @Failure 400 {string} string "Check the event and both links" @Failure 401 {string} string "Sign in first" @Failure 403 {string} string "Final submission is closed" @Router /v1/cs/project [post]

func UploadAbstractSubmission

func UploadAbstractSubmission(c echo.Context) error

UploadAbstractSubmission

@Summary Upload abstract submission to server @Schemes @Description Uploads the abstract submission to the server @Tags CodeSangam @Accept json @Param event formData string true "event" @Param file formData file true "file" @Success 200 {string} string @Router /v1/cs/abstract [post]

func UploadMidTermEval

func UploadMidTermEval(c echo.Context) error

UploadMidTermEval

@Summary Upload mid term evaluation to server @Schemes @Description Uploads the mid term evaluation to the server @Tags CodeSangam @Accept json @Param event formData string true "event" @Param file formData file true "file" @Success 200 {string} string @Router /v1/cs/midterm [post]

func UserDashboard

func UserDashboard(c echo.Context) error

UserDashboard

@Summary Get user profile @Schemes @Description Get user profile @Tags Auth @Security OAuth2 @Accept json @Produce html @Failure 401 {string} Unauthorized @Router /auth/dashboard [get]

Types

This section is empty.

Jump to

Keyboard shortcuts

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