Documentation
¶
Overview ¶
Package apptest is the compiled source for docs/guide/testing-your-app.md: a small application, and the specs that hold it to the library's contracts.
templ: version: v0.3.1020
Index ¶
Constants ¶
const ( EventInc = "count.inc" EventReset = "count.reset" FragmentValue = "count.value" FragmentLabel = "count.label" )
Variables ¶
var ( Admin = User{Name: "admin"} Guest = User{Name: "guest"} )
Admin and Guest are the two identities the specs bind a session to.
Functions ¶
func Config ¶
Config is the application, built by a function so a spec can construct one without a running server.
func LabelRegion ¶
func ValueRegion ¶
Types ¶
type User ¶
type User struct {
// Name is the subject, and what Authorize compares.
Name string
}
User is the identity this application binds a session to.
One type rather than two since 2026-09-03: a Config carries its identity type as a type parameter, so an application has exactly one, and "an admin" and "a guest" are two VALUES of it rather than two types. That is also the honest model — a real application authenticates one kind of principal and reads a role off it.