Documentation ¶
Index ¶
- Constants
- Variables
- func AsBool(str string) bool
- func AsStr(v bool) string
- func ContextWithHx(c *fiber.Ctx) *fiber.Ctx
- func New(config ...Config) fiber.Handler
- func NewCompHandler(n Node, config ...Config) fiber.Handler
- func NewHtmxHandler(handler HtmxHandlerFunc, config ...Config) fiber.Handler
- type ClassNames
- type Config
- type HTML5Props
- type Htmx
- func (h *Htmx) Ctx() *fiber.Ctx
- func (h *Htmx) IsHxBoosted() bool
- func (h *Htmx) IsHxHistoryRestoreRequest() bool
- func (h *Htmx) IsHxRequest() bool
- func (h *Htmx) ReSelect(target string)
- func (h *Htmx) ReSwap(target string)
- func (h *Htmx) ReTarget(target string)
- func (h *Htmx) Redirect(url string)
- func (h *Htmx) RenderComp(n Node) error
- func (h *Htmx) RenderPartial() bool
- func (h *Htmx) ReplaceURL(url string)
- func (h *Htmx) StopPolling() error
- func (h *Htmx) Trigger(target string)
- func (h *Htmx) Write(data []byte) (n int, err error)
- func (h *Htmx) WriteHTML(html template.HTML) (n int, err error)
- func (h *Htmx) WriteJSON(data any) (n int, err error)
- func (h *Htmx) WriteString(s string) (n int, err error)
- type HtmxHandlerFunc
- type Hx
- type HxClassName
- type HxEventType
- type HxRequestHeader
- type HxResponseHeader
- type HxResponseHeaders
- type Node
- func A(children ...Node) Node
- func Abbr(children ...Node) Node
- func Accept(v string) Node
- func Action(v string) Node
- func Address(children ...Node) Node
- func Alt(v string) Node
- func Area(children ...Node) Node
- func Aria(name, v string) Node
- func Article(children ...Node) Node
- func As(v string) Node
- func Aside(children ...Node) Node
- func Async() Node
- func Attribute(name string, value ...string) Node
- func Audio(children ...Node) Node
- func AutoComplete(v string) Node
- func AutoFocus() Node
- func AutoPlay() Node
- func B(children ...Node) Node
- func Base(children ...Node) Node
- func BlockQuote(children ...Node) Node
- func Body(children ...Node) Node
- func Br(children ...Node) Node
- func Button(children ...Node) Node
- func Canvas(children ...Node) Node
- func Caption(children ...Node) Node
- func Charset(v string) Node
- func Checked() Node
- func Cite(children ...Node) Node
- func Class(v string) Node
- func Code(children ...Node) Node
- func Col(children ...Node) Node
- func ColGroup(children ...Node) Node
- func ColSpan(v string) Node
- func Cols(v string) Node
- func Content(v string) Node
- func Controls() Node
- func DElement(children ...Node) Node
- func DataAttribute(name, v string) Node
- func DataElement(children ...Node) Node
- func DataList(children ...Node) Node
- func Dd(children ...Node) Node
- func Defer() Node
- func Details(children ...Node) Node
- func Dfn(children ...Node) Node
- func Dialog(children ...Node) Node
- func Disabled() Node
- func Div(children ...Node) Node
- func Dl(children ...Node) Node
- func Doctype(sibling Node) Node
- func Dt(children ...Node) Node
- func Element(name string, children ...Node) Node
- func Em(children ...Node) Node
- func Embed(children ...Node) Node
- func EncType(v string) Node
- func FieldSet(children ...Node) Node
- func FigCaption(children ...Node) Node
- func Figure(children ...Node) Node
- func Footer(children ...Node) Node
- func For(v string) Node
- func FormAttribute(v string) Node
- func FormElement(children ...Node) Node
- func Group(children ...Node) Node
- func H1(children ...Node) Node
- func H2(children ...Node) Node
- func H3(children ...Node) Node
- func H4(children ...Node) Node
- func H5(children ...Node) Node
- func H6(children ...Node) Node
- func HGroup(children ...Node) Node
- func HTML(children ...Node) Node
- func HTML5(p HTML5Props) Node
- func Head(children ...Node) Node
- func Header(children ...Node) Node
- func Height(v string) Node
- func Hr(children ...Node) Node
- func Href(v string) Node
- func HxBoost(v bool) Node
- func HxConfirm(msg string) Node
- func HxDelete(url string) Node
- func HxDisable() Node
- func HxEncoding(enc string) Node
- func HxExt(ext string) Node
- func HxGet(url string) Node
- func HxIndicator(target string) Node
- func HxOn(target string, js string) Node
- func HxPath(url string) Node
- func HxPost(url string) Node
- func HxPrompt(msg string) Node
- func HxPushUrl(v bool) Node
- func HxPut(url string) Node
- func HxSelect(target string) Node
- func HxSelectOob(target string) Node
- func HxSwap(target string) Node
- func HxSwapOob(target string) Node
- func HxTarget(target string) Node
- func HxTrigger(target string) Node
- func HxValidate(v bool) Node
- func I(children ...Node) Node
- func ID(v string) Node
- func IFrame(children ...Node) Node
- func If(condition bool, n Node) Node
- func Img(children ...Node) Node
- func Input(children ...Node) Node
- func Ins(children ...Node) Node
- func Kbd(children ...Node) Node
- func LabElement(children ...Node) Node
- func Lang(v string) Node
- func Legend(children ...Node) Node
- func Li(children ...Node) Node
- func Link(children ...Node) Node
- func Loading(v string) Node
- func Loop() Node
- func Main(children ...Node) Node
- func Mark(children ...Node) Node
- func Max(v string) Node
- func MaxLength(v string) Node
- func Menu(children ...Node) Node
- func Meta(children ...Node) Node
- func Meter(children ...Node) Node
- func Method(v string) Node
- func Min(v string) Node
- func MinLength(v string) Node
- func Multiple() Node
- func Muted() Node
- func Name(v string) Node
- func Nav(children ...Node) Node
- func NoScript(children ...Node) Node
- func Object(children ...Node) Node
- func Ol(children ...Node) Node
- func OptGroup(children ...Node) Node
- func Option(children ...Node) Node
- func P(children ...Node) Node
- func Param(children ...Node) Node
- func Pattern(v string) Node
- func Picture(children ...Node) Node
- func Placeholder(v string) Node
- func PlaysInline() Node
- func Poster(v string) Node
- func Pre(children ...Node) Node
- func Preload(v string) Node
- func Progress(children ...Node) Node
- func Q(children ...Node) Node
- func Raw(t string) Node
- func Rawf(format string, a ...interface{}) Node
- func ReadOnly() Node
- func Rel(v string) Node
- func Required() Node
- func Role(v string) Node
- func RowSpan(v string) Node
- func Rows(v string) Node
- func S(children ...Node) Node
- func SVG(children ...Node) Node
- func Samp(children ...Node) Node
- func Script(children ...Node) Node
- func Section(children ...Node) Node
- func Select(children ...Node) Node
- func Selected() Node
- func Small(children ...Node) Node
- func Source(children ...Node) Node
- func Span(children ...Node) Node
- func Src(v string) Node
- func SrcSet(v string) Node
- func Step(v string) Node
- func Strong(children ...Node) Node
- func StyleAttribute(v string) Node
- func StyleElement(children ...Node) Node
- func Sub(children ...Node) Node
- func Summary(children ...Node) Node
- func Sup(children ...Node) Node
- func TBody(children ...Node) Node
- func TFoot(children ...Node) Node
- func THead(children ...Node) Node
- func TabIndex(v string) Node
- func Table(children ...Node) Node
- func Target(v string) Node
- func Td(children ...Node) Node
- func Text(t string) Node
- func Textarea(children ...Node) Node
- func Textf(format string, a ...interface{}) Node
- func Th(children ...Node) Node
- func Time(children ...Node) Node
- func TitleAttribute(v string) Node
- func TitleElement(children ...Node) Node
- func Tr(children ...Node) Node
- func Type(v string) Node
- func U(children ...Node) Node
- func Ul(children ...Node) Node
- func Value(v string) Node
- func Var(children ...Node) Node
- func Video(children ...Node) Node
- func Wbr(children ...Node) Node
- func Width(v string) Node
- type NodeFunc
- type NodeType
- type NodeTypeDescriptor
Constants ¶
View Source
const ( ElementType = NodeType(iota) AttributeType )
View Source
const (
// StatusStopPolling ...
StatusStopPolling = 286
)
Variables ¶
View Source
var ConfigDefault = Config{
ErrorHandler: defaultErrorHandler,
}
ConfigDefault is the default config.
Functions ¶
func NewCompHandler ¶ added in v1.0.1
NewCompHandler ...
func NewHtmxHandler ¶
func NewHtmxHandler(handler HtmxHandlerFunc, config ...Config) fiber.Handler
NewHtmxHandler ...
Types ¶
type ClassNames ¶ added in v1.0.1
ClassNames ...
type Config ¶
type Config struct { // Next defines a function to skip this middleware when returned true. Next func(c *fiber.Ctx) bool // ErrorHandler is executed when an error is returned from fiber.Handler. // // Optional. Default: DefaultErrorHandler ErrorHandler fiber.ErrorHandler }
Config ...
type HTML5Props ¶ added in v1.0.1
HTML5Props ...
type Htmx ¶
type Htmx struct {
// contains filtered or unexported fields
}
Htmx ...
func (*Htmx) IsHxHistoryRestoreRequest ¶
IsHxHistoryRestoreRequest ...
type Hx ¶
type Hx struct { HxBoosted bool HxCurrentURL string HxHistoryRestoreRequest bool HxPrompt string HxRequest bool HxTarget string HxTriggerName string HxTrigger string }
Hx ...
type HxClassName ¶ added in v1.0.1
type HxClassName string
HxClassName ...
const ( HxClassNameAdded HxClassName = "htmx-added" HxClassNameIndicator HxClassName = "htmx-indicator" HxClassNameRequest HxClassName = "htmx-request" HxClassNameSettling HxClassName = "htmx-settling" HxClassNameSwapping HxClassName = "htmx-swapping" )
type HxEventType ¶ added in v1.0.1
type HxEventType string
HxEventType ...
const ( HxEventTypeAbort HxEventType = "htmx:abort" HxEventTypeAfterLoad HxEventType = "htmx:afterLoad" HxEventTypeAfterProcessNode HxEventType = "htmx:afterProcessNode" HxEventTypeAfterRequest HxEventType = "htmx:afterRequest" )
type HxRequestHeader ¶
type HxRequestHeader string
HxRequestHeader ...
const ( HxRequestHeaderBoosted HxRequestHeader = "HX-Boosted" HxRequestHeaderCurrentURL HxRequestHeader = "HX-Current-URL" HxRequestHeaderHistoryRestoreRequest HxRequestHeader = "HX-History-Restore-Request" HxRequestHeaderPrompt HxRequestHeader = "HX-Prompt" HxRequestHeaderRequest HxRequestHeader = "HX-Request" HxRequestHeaderTarget HxRequestHeader = "HX-Target" HxRequestHeaderTrigger HxRequestHeader = "HX-Trigger" HxRequestHeaderTriggerName HxRequestHeader = "HX-Trigger-Name" )
type HxResponseHeader ¶
type HxResponseHeader string
HxResponseHeader ...
const ( HXLocation HxResponseHeader = "HX-Location" // Allows you to do a client-side redirect that does not do a full page reload HXPushUrl HxResponseHeader = "HX-Push-Url" // pushes a new url into the history stack HXRedirect HxResponseHeader = "HX-Redirect" // can be used to do a client-side redirect to a new location HXRefresh HxResponseHeader = "HX-Refresh" // if set to "true" the client side will do a full refresh of the page HXReplaceUrl HxResponseHeader = "HX-Replace-Url" // replaces the current URL in the location bar HXReswap HxResponseHeader = "HX-Reswap" // Allows you to specify how the response will be swapped. See hx-swap for possible values HXRetarget HxResponseHeader = "HX-Retarget" // A CSS selector that updates the target of the content update to a different element on the page HXReselect HxResponseHeader = "HX-Reselect" // A CSS selector that allows you to choose which part of the response is used to be swapped in. Overrides an existing hx-select on the triggering element HXTrigger HxResponseHeader = "HX-Trigger" // allows you to trigger client side events, see the documentation for more info HXTriggerAfterSettle HxResponseHeader = "HX-Trigger-After-Settle" // allows you to trigger client side events, see the documentation for more info HXTriggerAfterSwap HxResponseHeader = "HX-Trigger-After-Swap" // allows you to trigger client side events, see the documentation for more info )
type HxResponseHeaders ¶
type HxResponseHeaders struct {
// contains filtered or unexported fields
}
HxResponseHeaders ...
func (*HxResponseHeaders) Set ¶
func (h *HxResponseHeaders) Set(k HxResponseHeader, val string)
Set ...
type Node ¶ added in v1.0.1
Node ...
func AutoComplete ¶ added in v1.0.1
func DataAttribute ¶ added in v1.0.1
func FigCaption ¶ added in v1.0.1
func FormAttribute ¶ added in v1.0.1
func FormElement ¶ added in v1.0.1
func HxEncoding ¶ added in v1.0.1
func HxIndicator ¶ added in v1.0.1
func HxSelectOob ¶ added in v1.0.1
func HxValidate ¶ added in v1.0.1
func LabElement ¶ added in v1.0.1
func Placeholder ¶ added in v1.0.1
func PlaysInline ¶ added in v1.0.1
func PlaysInline() Node
func StyleAttribute ¶ added in v1.0.1
func StyleElement ¶ added in v1.0.1
func TitleAttribute ¶ added in v1.0.1
func TitleElement ¶ added in v1.0.1
type NodeTypeDescriptor ¶ added in v1.0.1
type NodeTypeDescriptor interface {
Type() NodeType
}
NodeTypeDescriptor ...
Click to show internal directories.
Click to hide internal directories.