handlers

package
v0.0.0-...-9993f1c Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RepoPrefix is the badger prefix for repos
	RepoPrefix string = "repos-"
)

Variables

This section is empty.

Functions

func BadgeHandler

func BadgeHandler(w http.ResponseWriter, r *http.Request, db *badger.DB, repo string)

BadgeHandler handles fetching the badge images

func CheckHandler

func CheckHandler(w http.ResponseWriter, r *http.Request, db *badger.DB)

CheckHandler handles the request for checking a repo

Types

type GRCHandler

type GRCHandler struct {
	AssetsFS http.FileSystem
}

GRCHandler contains fields shared among the different handlers

func (*GRCHandler) AboutHandler

func (gh *GRCHandler) AboutHandler(w http.ResponseWriter, r *http.Request)

AboutHandler handles the about page

func (*GRCHandler) HighScoresHandler

func (gh *GRCHandler) HighScoresHandler(w http.ResponseWriter, r *http.Request, db *badger.DB)

HighScoresHandler handles the stats page

func (*GRCHandler) HomeHandler

func (gh *GRCHandler) HomeHandler(w http.ResponseWriter, r *http.Request, db *badger.DB)

HomeHandler handles the homepage

func (*GRCHandler) ReportHandler

func (gh *GRCHandler) ReportHandler(w http.ResponseWriter, r *http.Request, db *badger.DB, repo string)

ReportHandler handles the report page

func (*GRCHandler) SupportersHandler

func (gh *GRCHandler) SupportersHandler(w http.ResponseWriter, r *http.Request)

SupportersHandler handles the supporters page

type ScoreHeap

type ScoreHeap []scoreItem

An ScoreHeap is a min-heap of ints.

func (ScoreHeap) Len

func (h ScoreHeap) Len() int

func (ScoreHeap) Less

func (h ScoreHeap) Less(i, j int) bool

func (*ScoreHeap) Pop

func (h *ScoreHeap) Pop() interface{}

Pop item off of the heap

func (*ScoreHeap) Push

func (h *ScoreHeap) Push(x interface{})

Push onto the heap

func (ScoreHeap) Swap

func (h ScoreHeap) Swap(i, j int)

Jump to

Keyboard shortcuts

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