govlab

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 10 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

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