htmx

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	HeaderRequest            = "HX-Request"
	HeaderBoosted            = "HX-Boosted"
	HeaderTrigger            = "HX-Trigger"
	HeaderTriggerName        = "HX-Trigger-Name"
	HeaderTriggerAfterSwap   = "HX-Trigger-After-Swap"
	HeaderTriggerAfterSettle = "HX-Trigger-After-Settle"
	HeaderTarget             = "HX-Target"
	HeaderPrompt             = "HX-Prompt"
	HeaderPush               = "HX-Push"
	HeaderRedirect           = "HX-Redirect"
	HeaderRefresh            = "HX-Refresh"
)

Headers (https://htmx.org/docs/#requests)

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

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

Request contains data that HTMX provides during requests

func GetRequest

func GetRequest(ctx *gin.Context) Request

GetRequest extracts HTMX data from the request

type Response

type Response struct {
	Push               string
	Redirect           string
	Refresh            bool
	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 *gin.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