http

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormField

type FormField struct {
	ID string `json:"id"`
	// Input fields
	Name            string   `json:"name"`
	Label           string   `json:"label"`
	Type            string   `json:"type"`
	Required        bool     `json:"required"`
	Options         []string `json:"options"`
	Placeholder     string   `json:"placeholder"`
	Help            string   `json:"help"`
	NumberKind      string   `json:"number_kind"`
	Render          string   `json:"render"`
	VerifyEmail     bool     `json:"verify_email"`
	RejectIfInvalid bool     `json:"reject_if_invalid"`
	Min             float64  `json:"min"`
	Max             float64  `json:"max"`
	Step            float64  `json:"step"`
	StartLabel      string   `json:"start_label"`
	EndLabel        string   `json:"end_label"`
	// Layout metadata
	Section string `json:"section"`
	Width   string `json:"width"` // auto | half | full
	// Layout-only content
	Content string `json:"content"` // for heading/text_block
	Level   int    `json:"level"`   // 1..3 for heading
}

type FormHandler

type FormHandler struct {
	*handlers.Handler
}

func NewFormHandler

func NewFormHandler(h *handlers.Handler) *FormHandler

func (*FormHandler) HandleForm

func (h *FormHandler) HandleForm(w http.ResponseWriter, r *http.Request)

func (*FormHandler) ListTemplates

func (h *FormHandler) ListTemplates(w http.ResponseWriter, r *http.Request)

func (*FormHandler) RegisterFormRoutes

func (h *FormHandler) RegisterFormRoutes(mux *http.ServeMux)

HandleForm receives form submissions (JSON, x-www-form-urlencoded, or multipart)

func (*FormHandler) RenderField

func (h *FormHandler) RenderField(f FormField) string

func (*FormHandler) ServeFormPage

func (h *FormHandler) ServeFormPage(w http.ResponseWriter, r *http.Request)

ServeFormPage renders a public HTML form for a configured form source path.

func (*FormHandler) ServeFormScript

func (h *FormHandler) ServeFormScript(w http.ResponseWriter, r *http.Request)

ServeFormScript returns a small JS snippet to embed a form.

type TemplateDef

type TemplateDef struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Icon        string `json:"icon"`
	Color       string `json:"color"`
	Data        any    `json:"data"`
}

Jump to

Keyboard shortcuts

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