redirecting

package
v0.4.14 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package redirecting provides HTMX-compatible semantics by redirecting state-changing HTTP requests (POST, PUT, DELETE) back to a canonical GET endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Redirect

func Redirect(w http.ResponseWriter, r *http.Request, target string)

Redirect handles PRG and HTMX-compatible redirects.

func RedirectWithMessage

func RedirectWithMessage(w http.ResponseWriter, r *http.Request, target, key, value string)

RedirectWithMessage appends a query message and performs a redirect.

func WithPRG

func WithPRG(next http.Handler) http.Handler

WithPRG wraps handlers to automatically handle PRG pattern redirects. It intercepts POST requests and manages redirect responses.

Types

This section is empty.

Jump to

Keyboard shortcuts

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