ui

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 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 ui renders the shared browser pages. Pages are script-free except those that define a "scripts" block (passkey ceremonies and the approval inbox), which load only a same-origin script under a matching Content-Security-Policy.

Index

Constants

View Source
const ImageSource = "img-src data:"

ImageSource is the CSP directive pages need for the inline icon. Inline data keeps pages free of extra routes that proxies would have to forward.

Variables

This section is empty.

Functions

func Icon added in v0.4.0

func Icon(w http.ResponseWriter, _ *http.Request)

Icon serves the shared application icon for installed approval inboxes.

func Message

func Message(w http.ResponseWriter, status int, title, message string)

Message renders a short informational or error page in the shared layout.

func NewTemplate

func NewTemplate(source string) *template.Template

NewTemplate adds trusted title and content definitions to the shared layout. All request data must be passed to Execute, never interpolated into source.

func Render

func Render(w http.ResponseWriter, status int, page *template.Template, data any)

Render buffers a page before writing the response so render errors cannot expose a partially rendered form.

Types

This section is empty.

Jump to

Keyboard shortcuts

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