web

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 23 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

This section is empty.

Variables

View Source
var VersionTag string

Functions

func ConfigRouter added in v1.15.0

func ConfigRouter(router *tools.Router)

ConfigRouter mounts every page. The SPA is the only frontend, so a missing build is a broken deployment: it stops the server here instead of answering every page with an error.

func HandleValidLogin

func HandleValidLogin(w http.ResponseWriter, r *http.Request, data *tools.SessionData)

HandleValidLogin starts a session and redirects the user to the page they were trying to access.

func IsFreshInstallation

func IsFreshInstallation(ctx context.Context, usersDao dao.UsersDao) (bool, error)

IsFreshInstallation Checks whether there are users in the database and returns true if so, false if not.

func SetLoginRedirectCookie added in v1.7.10

func SetLoginRedirectCookie(w http.ResponseWriter, r *http.Request)

SetLoginRedirectCookie stores where to send the user once they have logged in.

It has to happen while serving the login page, before the user picks between the internal form and an external identity provider, because an external login leaves the site entirely and comes back without the original query string. It is exported so that the route serving the SPA login page keeps the same behaviour.

Types

type CacheMetrics

type CacheMetrics struct {
	Hits      uint64 `json:"hits"`
	Misses    uint64 `json:"misses"`
	KeysAdded uint64 `json:"keysAdded"`
}

type HealthCheckData

type HealthCheckData struct {
	Version      string       `json:"version"`
	CacheMetrics CacheMetrics `json:"cacheMetrics"`
}

Jump to

Keyboard shortcuts

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