htmx

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderBoosted               = "HX-Boosted"
	HeaderHistoryRestoreRequest = "HX-History-Restore-Request"
	HeaderPrompt                = "HX-Prompt"
	HeaderRequest               = "HX-Request"
	HeaderTarget                = "HX-Target"
	HeaderTrigger               = "HX-Trigger"
	HeaderTriggerName           = "HX-Trigger-Name"
)

Request headers: https://htmx.org/docs/#request-headers

View Source
const (
	HeaderPushURL            = "HX-Push-Url"
	HeaderRedirect           = "HX-Redirect"
	HeaderReplaceURL         = "HX-Replace-Url"
	HeaderRefresh            = "HX-Refresh"
	HeaderTriggerAfterSettle = "HX-Trigger-After-Settle"
	HeaderTriggerAfterSwap   = "HX-Trigger-After-Swap"
)

Response headers: https://htmx.org/docs/#response-headers

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Enabled        bool
	Boosted        bool
	HistoryRestore bool
	Trigger        string
	TriggerName    string
	Target         string
	Prompt         string
}

Request contains data that HTMX provides during requests

func GetRequest

func GetRequest(ctx echo.Context) Request

GetRequest extracts HTMX data from the request

type Response

type Response struct {
	PushURL            string
	Redirect           string
	Refresh            bool
	ReplaceURL         string
	Trigger            string
	TriggerAfterSwap   string
	TriggerAfterSettle string
	NoContent          bool
}

Response contain data that the server can communicate back to HTMX

func (Response) Apply

func (r Response) Apply(ctx echo.Context)

Apply applies data from a Response to a server response

Jump to

Keyboard shortcuts

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