browserpage

package
v0.1.0-rc.49 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: BSD-3-Clause Imports: 11 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 browserpage owns tnl's standalone browser presentation. it depends only on bundled fonts and the standard library; callers retain routing, authentication, status codes, and page-specific security policy.

Index

Constants

View Source
const ContentSecurityPolicy = pageSecurityPolicy + "; form-action 'none'"
View Source
const FormSecurityPolicy = pageSecurityPolicy + "; form-action 'self'"

Variables

This section is empty.

Functions

func AcceptsHTML

func AcceptsHTML(accept string) bool

AcceptsHTML requires an explicit html preference; api clients and callers accepting only */* keep their original machine-readable response.

func Error

func Error(w http.ResponseWriter, r *http.Request, message string, status int)
func FaviconLink() string

FaviconLink returns fixed markup for pages that allow data: images.

func Headers

func Headers(w http.ResponseWriter)

func MessageHTML

func MessageHTML(message Message) string

keep the portable message and handoff pages on fixed markup. html/template looks up methods by name at runtime, which made the linker keep unused control client methods in the wasm build.

func Redirect

func Redirect(w http.ResponseWriter, location string)

func WriteMessage

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

Types

type Message

type Message struct {
	Title, Summary, Code, RequestID, HelpURL string
	Paragraphs                               []string
}

type Page

type Page struct {
	Title   string
	Content any
}

type Template

type Template struct {
	// contains filtered or unexported fields
}

func New

func New(body string) *Template

New composes an authored control or development page with the shared shell. pass data through Page.Content so html/template escapes it in context. the portable pages do not use this renderer.

func (*Template) HTML

func (t *Template) HTML(page Page) string

func (*Template) Write

func (t *Template) Write(w io.Writer, page Page) error

Jump to

Keyboard shortcuts

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