Documentation ¶
Index ¶
- func CurrentURL(req *http.Request) (*url.URL, error)
- func IsBoosted(req *http.Request) bool
- func IsHistoryRestoreRequest(req *http.Request) bool
- func IsRequest(req *http.Request) bool
- func Prompt(req *http.Request) (string, bool)
- func SetLocation(res http.ResponseWriter, url string)
- func SetPreventHistoryUpdate(res http.ResponseWriter)
- func SetPushURL(res http.ResponseWriter, url string)
- func SetRedirect(res http.ResponseWriter, url string)
- func SetRefresh(res http.ResponseWriter)
- func SetReplaceURL(res http.ResponseWriter, url string)
- func SetSelect(res http.ResponseWriter, value string)
- func SetSwap(res http.ResponseWriter, s Swap)
- func SetTarget(res http.ResponseWriter, value string)
- func SetTriggerAfterSettleEvents(res http.ResponseWriter, events ...string)
- func SetTriggerAfterSettleWithData(res http.ResponseWriter, data EventsWithData) error
- func SetTriggerAfterSwapEvents(res http.ResponseWriter, events ...string)
- func SetTriggerAfterSwapWithData(res http.ResponseWriter, data EventsWithData) error
- func SetTriggerEvents(res http.ResponseWriter, events ...string)
- func SetTriggerWithData(res http.ResponseWriter, data EventsWithData) error
- func Target(req *http.Request) (string, bool)
- func TriggerID(req *http.Request) (string, bool)
- func TriggerName(req *http.Request) (string, bool)
- type EventsWithData
- type Swap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentURL ¶
CurrentURL returns the value of the HX-Current-URL header, if present.
func IsHistoryRestoreRequest ¶
IsHistoryRestoreRequest reports whether the HX-History-Restore-Request request header set to "true".
func SetLocation ¶
func SetLocation(res http.ResponseWriter, url string)
SetLocation sets the HX-Location header to the given URL. See https://htmx.org/headers/hx-location/
func SetPreventHistoryUpdate ¶
func SetPreventHistoryUpdate(res http.ResponseWriter)
func SetPushURL ¶
func SetPushURL(res http.ResponseWriter, url string)
SetPushURL sets the HX-Push-Url header to the given URL. See https://htmx.org/headers/hx-push-url/
func SetRedirect ¶
func SetRedirect(res http.ResponseWriter, url string)
SetRedirect sets the HX-Redirect header to the given URL. See https://htmx.org/reference/#response_headers
func SetRefresh ¶
func SetRefresh(res http.ResponseWriter)
SetRefresh sets the HX-Refresh header to "true". It tells the client to refresh the page.
func SetReplaceURL ¶
func SetReplaceURL(res http.ResponseWriter, url string)
SetReplaceURL sets the HX-Replace header to the given URL. See https://htmx.org/headers/hx-replace/
func SetSelect ¶
func SetSelect(res http.ResponseWriter, value string)
SetSelect sets the HX-Reselect header to the given value.
func SetSwap ¶
func SetSwap(res http.ResponseWriter, s Swap)
SetSwap sets the HX-Reswap header to the given value.
func SetTarget ¶
func SetTarget(res http.ResponseWriter, value string)
SetTarget sets the HX-Retarget header to the given value.
func SetTriggerAfterSettleEvents ¶
func SetTriggerAfterSettleEvents(res http.ResponseWriter, events ...string)
func SetTriggerAfterSettleWithData ¶
func SetTriggerAfterSettleWithData(res http.ResponseWriter, data EventsWithData) error
func SetTriggerAfterSwapEvents ¶
func SetTriggerAfterSwapEvents(res http.ResponseWriter, events ...string)
func SetTriggerAfterSwapWithData ¶
func SetTriggerAfterSwapWithData(res http.ResponseWriter, data EventsWithData) error
func SetTriggerEvents ¶
func SetTriggerEvents(res http.ResponseWriter, events ...string)
func SetTriggerWithData ¶
func SetTriggerWithData(res http.ResponseWriter, data EventsWithData) error
Types ¶
type EventsWithData ¶
type EventsWithData struct {
// contains filtered or unexported fields
}
func NewEventsWithData ¶
func NewEventsWithData(event string, data any) EventsWithData
func (EventsWithData) MarshalJSON ¶
func (e EventsWithData) MarshalJSON() ([]byte, error)
func (EventsWithData) Set ¶
func (e EventsWithData) Set(event string, data any) EventsWithData