htmx

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeInfo    = MessageType("info")
	TypeSuccess = MessageType("success")
	TypeError   = MessageType("error")
	TypeWarning = MessageType("warning")
)

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, r *http.Request, code int, text string) error

func HXRequest

func HXRequest(r *http.Request) bool

func Info

func Info(w http.ResponseWriter, r *http.Request, code int, text string) error

func Success

func Success(w http.ResponseWriter, r *http.Request, code int, text string) error

func Warning

func Warning(w http.ResponseWriter, r *http.Request, code int, text string) error

Types

type Message

type Message struct {
	Code int
	Text string
	Type MessageType
}

func ErrorMessage

func ErrorMessage(code int, text string) Message

func InfoMessage

func InfoMessage(code int, text string) Message

func NewMessage

func NewMessage(code int, text string, typ MessageType) Message

func SuccessMessage

func SuccessMessage(code int, text string) Message

func WarningMessage

func WarningMessage(code int, text string) Message

func (Message) Render

func (m Message) Render(w http.ResponseWriter, r *http.Request) error

type MessageType

type MessageType string

func (MessageType) Icon

func (t MessageType) Icon() string

Jump to

Keyboard shortcuts

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