Documentation
¶
Index ¶
- func Addon() gowdk.Addon
- func ComposeLayouts(ctx LoadContext, stack LayoutStack, registry LayoutRegistry, body string) (string, error)
- func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error)
- func Register(router Router, routes []Route)
- func RunGuards(ctx LoadContext, names []string, registry GuardRegistry) error
- type ErrorHandler
- type GuardFunc
- type GuardRegistry
- type LayoutFunc
- type LayoutRegistry
- type LayoutStack
- type LoadContext
- type LoadFunc
- type Route
- type Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeLayouts ¶
func ComposeLayouts(ctx LoadContext, stack LayoutStack, registry LayoutRegistry, body string) (string, error)
ComposeLayouts wraps body with the declared layout stack. Layouts are listed from outermost to innermost, matching @layout root, dashboard semantics.
func DefaultErrorHandler ¶
func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error)
DefaultErrorHandler renders a conservative SSR failure response.
func RunGuards ¶
func RunGuards(ctx LoadContext, names []string, registry GuardRegistry) error
RunGuards executes guard IDs in declaration order.
Types ¶
type ErrorHandler ¶
type ErrorHandler func(http.ResponseWriter, *http.Request, error)
ErrorHandler renders request-time SSR failures.
type GuardFunc ¶
type GuardFunc func(LoadContext) error
GuardFunc authorizes one request-time SSR page access check.
type GuardRegistry ¶
GuardRegistry resolves @guard IDs to executable guard functions.
type LayoutFunc ¶
type LayoutFunc func(LoadContext, string) (string, error)
LayoutFunc wraps already-rendered child HTML with request-aware layout HTML.
type LayoutRegistry ¶
type LayoutRegistry map[string]LayoutFunc
LayoutRegistry maps layout IDs to request-aware layout functions.
type LayoutStack ¶
type LayoutStack []string
LayoutStack is the ordered set of request-time layouts for an SSR page.
type LoadContext ¶
LoadContext is passed to generated request-time load {} functions.
func NewLoadContext ¶
func NewLoadContext(request *http.Request, session map[string]any) LoadContext
NewLoadContext creates the first-slice request context for generated SSR load functions. Session storage is intentionally caller-supplied until the SSR addon defines secure session defaults.
type LoadFunc ¶
type LoadFunc func(LoadContext) (map[string]any, error)
LoadFunc is generated from a request-time load {} block.