render

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StaticFS embed.FS

Functions

This section is empty.

Types

type Data

type Data struct {
	Title string
	Forms []*form.Form
	Form  *form.Form
	Slug  string
	Err   string
	Dir   string
}

type Renderer

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

Renderer renders the index, form, and error pages from snapshots provided by the store.

func New

func New(s *store.Store) (*Renderer, error)

func (*Renderer) Form

func (r *Renderer) Form(rw http.ResponseWriter, slug string) error

Form renders a single form, falling back to the error page on a load error.

func (*Renderer) Index

func (r *Renderer) Index(rw http.ResponseWriter) error

Index renders the index page or, if the snapshot has a load error, the error page (with the same top-bar layout) so the user sees the validation problem in the browser.

Jump to

Keyboard shortcuts

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