Documentation
¶
Index ¶
- func HandlerStatus(err error, fallback int) int
- func NewHandlerError(status int, message string, cause error) error
- func WriteHTTP(writer http.ResponseWriter, result Response) error
- func WriteNoStoreError(writer http.ResponseWriter, status int, message string)
- func WriteNoStoreHTML(writer http.ResponseWriter, request *http.Request, body string) error
- func WriteNoStoreHTTP(writer http.ResponseWriter, result Response) error
- type HandlerError
- type Kind
- type Response
- func FragmentFor(target, body string) Response
- func FragmentSwap(target string, swap SwapMode, body string) (Response, error)
- func HTMLBody(status int, body string) Response
- func JSONBody(status int, body string) Response
- func JSONValue(status int, value any) (Response, error)
- func RedirectTo(url string) Response
- type SwapMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerStatus ¶
HandlerStatus returns a handler error status, or fallback for ordinary errors.
func NewHandlerError ¶
NewHandlerError creates an error suitable for generated handlers.
func WriteHTTP ¶
func WriteHTTP(writer http.ResponseWriter, result Response) error
WriteHTTP writes a runtime response envelope to net/http.
func WriteNoStoreError ¶
func WriteNoStoreError(writer http.ResponseWriter, status int, message string)
WriteNoStoreError writes an HTTP error that must not be cached.
func WriteNoStoreHTML ¶
WriteNoStoreHTML writes a no-store HTML response and suppresses the body for HEAD requests.
func WriteNoStoreHTTP ¶
func WriteNoStoreHTTP(writer http.ResponseWriter, result Response) error
WriteNoStoreHTTP writes a response envelope that must not be cached.
Types ¶
type HandlerError ¶
HandlerError wraps failures raised by generated handlers.
func (HandlerError) Error ¶
func (err HandlerError) Error() string
func (HandlerError) Unwrap ¶
func (err HandlerError) Unwrap() error
type Kind ¶
type Kind string
Kind identifies the response shape produced by actions, fragments, APIs, or full-page rendering.
type Response ¶
Response is the generated runtime response envelope.
func FragmentFor ¶
FragmentFor creates a partial fragment response for a DOM target.
func FragmentSwap ¶
FragmentSwap creates a partial fragment response with an explicit swap mode.