govlab

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package govlab is GovLab, a government services portal: exam results looked up by roll number and date of birth with downloadable PDF marksheets, notices, and an online application (sign-in by one-time code, a form in sections, document upload, submission with an acknowledgement number and a PDF receipt) with a deadline. It is the reference app for the government pack.

Every query goes through a database pool of ten connections, as a portal's does; a query holds a connection for as long as it runs.

Planted bottlenecks (see README.md), each switched off by a fix flag:

  • index: results are found by scanning all 100,000 rows (200ns a row, 20ms a lookup) while holding a pool connection, so on results day the pool runs out (fix "index" looks the roll number up).
  • pdf: every marksheet and receipt compresses the 400 KB letterhead image again (fix "pdf" compresses it once and reuses the bytes).
  • lock: every application save takes one portal-wide lock and writes the whole application and an audit entry (2ms) before letting go, so on deadline day saves run one at a time (fix "lock" locks only the application being saved).

Index

Constants

View Source
const (
	// Candidates is how many exam results GovLab holds; roll numbers run
	// from FirstRoll upward.
	Candidates = 100_000
	// FirstRoll is the first roll number.
	FirstRoll = 26_000_001
)

Variables

This section is empty.

Functions

func DOB

func DOB(roll int) string

DOB is a candidate's date of birth (deterministic, so test data can be generated outside the app).

func New

func New(cfg labkit.Config) http.Handler

New returns GovLab's handler.

Types

This section is empty.

Jump to

Keyboard shortcuts

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