Versions in this module Expand all Collapse all v0 v0.4.11 Jun 6, 2026 v0.4.1 Jun 6, 2026 v0.4.0 Jun 6, 2026 Changes in this version + func AddClasses(ctx context.Context, id string, classes ...string) + func Blur(ctx context.Context, id string) + func Disable(ctx context.Context, id string) + func Enable(ctx context.Context, id string) + func EventData[T any](ctx context.Context) (T, error) + func Focus(ctx context.Context, id string) + func JS(ctx context.Context, fn string, arg any) + func MiddleWareFn(h http.HandlerFunc, hf HandleFn) http.HandlerFunc + func OnCacheChange[T any](c Cache[T], f func()) + func OnCacheTimeOut[T any](c Cache[T], f func()) + func RemoveAttribute(ctx context.Context, id string, name string) + func RemoveClasses(ctx context.Context, id string, classes ...string) + func RemoveElement(ctx context.Context, id string) + func RemoveStyle(ctx context.Context, id string, name string) + func RemoveTag(ctx context.Context, tag string) + func RenderComponent(c ...Component) (html string) + func ScrollIntoView(ctx context.Context, id string) + func SetAttribute(ctx context.Context, id string, name string, value string) + func SetConfig(c *Config) + func SetStyle(ctx context.Context, id string, name string, value string) + func SetText(ctx context.Context, id string, value string) + func SetValue(ctx context.Context, id string, value string) + type Cache struct + func NewCache[T any](ctx context.Context, key string, initial T) (Cache[T], error) + func UseCache[T any](ctx context.Context, key string) (Cache[T], error) + func (c *Cache[T]) CreatedAt() time.Time + func (c *Cache[T]) Delete() + func (c *Cache[T]) Expiry() time.Time + func (c *Cache[T]) History() (map[string]T, bool) + func (c *Cache[T]) Record(record bool) + func (c *Cache[T]) Set(data T, timeout ...time.Duration) error + func (c *Cache[T]) TimeOut() time.Duration + func (c *Cache[T]) UpdatedAt() time.Time + func (c *Cache[T]) Value() T + type CacheError string + const ErrCacheExists + const ErrCacheNotFound + const ErrCacheWrongType + const ErrStoreNotFound + func (e CacheError) Error() string + type CacheOnFn string + type Component interface + Render func(ctx context.Context, w io.Writer) error + type Config struct + CacheTimeOut time.Duration + LogLevel LogLevel + Logger *log.Logger + Silent bool + UploadDir string + UploadMaxBytes int64 + UploadMaxMemory int64 + func (c *Config) Set() + type ContextKey string + const ErrorKey + const EventKey + const RequestKey + type Dispatch struct + Action string + ConnID string + FnClass FnClass + FnCustom FnCustom + FnDOM FnDOM + FnError FnError + FnEvent EventListener + FnPing FnPing + FnRedirect FnRedirect + FnRender FnRender + Function functionName + HandlerID string + ID string + Key string + Label string + type DispatchError string + const ErrConnectionFailed + const ErrConnectionNotFound + const ErrCtxMissingDispatch + const ErrCtxMissingEvent + const ErrNoClientConnection + func (e DispatchError) Error() string + type DragEvent struct + AltKey bool + Bubbles bool + Button int + Buttons int + Cancelable bool + ClientX int + ClientY int + Component EventTarget + Composed bool + CtrlKey bool + DefaultPrevented bool + Detail int + EventPhase int + IsTrusted bool + MetaKey bool + MovementX int + MovementY int + OffsetX int + OffsetY int + PageX int + PageY int + RelatedTarget EventTarget + Source EventTarget + type EventListener struct + Data any + Handler HandleFn + ID string + On OnEvent + Submitter *EventTarget + TargetID string + Uploads []Upload + type EventTarget struct + Attributes []string + Checked bool + ClassList []string + Dataset []string + Disabled bool + Hidden bool + ID string + InnerHTML string + Name string + OuterHTML string + SelectedOptions []string + Style string + TagName string + Value string + func EventSubmitter(ctx context.Context) (*EventTarget, error) + type FnClass struct + Names []string + Remove bool + TargetID string + type FnComponent struct + func FnErr(ctx context.Context, err error) FnComponent + func NewFn(ctx context.Context, c Component) FnComponent + func RedirectURL(ctx context.Context, url string) FnComponent + func (f FnComponent) AppendElement(id string) FnComponent + func (f FnComponent) AppendTag(tag string) FnComponent + func (f FnComponent) Dispatch() + func (f FnComponent) JS(fn string, arg any) FnComponent + func (f FnComponent) PrependElement(id string) FnComponent + func (f FnComponent) PrependTag(tag string) FnComponent + func (f FnComponent) Render(ctx context.Context, w io.Writer) error + func (f FnComponent) SwapElementInner(id string) FnComponent + func (f FnComponent) SwapElementOuter(id string) FnComponent + func (f FnComponent) SwapTagInner(tag string) FnComponent + func (f FnComponent) SwapTagOuter(tag string) FnComponent + func (f FnComponent) WithContext(ctx context.Context) FnComponent + func (f FnComponent) WithError(err error) FnComponent + func (f FnComponent) WithEvents(h HandleFn, e ...OnEvent) FnComponent + func (f FnComponent) WithLabel(label string) FnComponent + func (f FnComponent) WithRedirect(url string) FnComponent + func (f FnComponent) Write(p []byte) (n int, err error) + type FnCustom struct + Data any + Function string + Result any + type FnDOM struct + Name string + Operation string + TargetID string + Value string + type FnError struct + Message string + type FnPing struct + Client bool + Server bool + type FnRedirect struct + URL string + type FnRender struct + Append bool + EventListeners []EventListener + HTML string + Inner bool + Outer bool + Prepend bool + Remove bool + Tag string + TargetID string + type FormDataEvent struct + Bubbles bool + Cancelable bool + Component EventTarget + Composed bool + DefaultPrevented bool + EventPhase int + FormData map[string]any + IsTrusted bool + type HTML string + func (h *HTML) Write(p []byte) (n int, err error) + func (h HTML) Render(ctx context.Context, w io.Writer) error + type HandleFn func(context.Context) FnComponent + type KeyboardEvent struct + AltKey bool + Bubbles bool + Cancelable bool + Code string + Component EventTarget + Composed bool + CtrlKey bool + DefaultPrevented bool + Detail int + EventPhase int + IsComposing bool + IsTrusted bool + Key string + Location int + MetaKey bool + Repeat bool + ShiftKey bool + Source EventTarget + type LogLevel log.Level + const Debug + const Error + const Fatal + const Info + const None + const Warn + type MouseEvent struct + AltKey bool + Bubbles bool + Button int + Buttons int + Cancelable bool + ClientX int + ClientY int + Component EventTarget + Composed bool + CtrlKey bool + DefaultPrevented bool + Detail int + EventPhase int + IsTrusted bool + MetaKey bool + MovementX int + MovementY int + OffsetX int + OffsetY int + PageX int + PageY int + RelatedTarget EventTarget + Source EventTarget + type OnEvent string + const OnAbort + const OnAnimationEnd + const OnAnimationIteration + const OnAnimationStart + const OnBlur + const OnCanPlay + const OnCanPlayThrough + const OnChange + const OnChangeCapture + const OnClick + const OnCompositionEnd + const OnCompositionStart + const OnCompositionUpdate + const OnContextMenuCapture + const OnCopy + const OnCut + const OnDoubleClickCapture + const OnDrag + const OnDragEnd + const OnDragEnter + const OnDragExitCapture + const OnDragLeave + const OnDragOver + const OnDragStart + const OnDrop + const OnDurationChange + const OnEmptied + const OnEncrypted + const OnEnded + const OnError + const OnFocus + const OnGotPointerCapture + const OnInput + const OnInvalid + const OnKeyDown + const OnKeyPress + const OnKeyUp + const OnLoad + const OnLoadEnd + const OnLoadStart + const OnLoadedData + const OnLoadedMetadata + const OnLostPointerCapture + const OnMouseDown + const OnMouseEnter + const OnMouseLeave + const OnMouseMove + const OnMouseOut + const OnMouseOver + const OnMouseUp + const OnPause + const OnPlay + const OnPlaying + const OnPointerCancel + const OnPointerDown + const OnPointerEnter + const OnPointerLeave + const OnPointerMove + const OnPointerOut + const OnPointerOver + const OnPointerUp + const OnProgress + const OnRateChange + const OnResetCapture + const OnScroll + const OnSeeked + const OnSeeking + const OnSelectCapture + const OnStalled + const OnSubmit + const OnSuspend + const OnTimeUpdate + const OnToggle + const OnTouchCancel + const OnTouchEnd + const OnTouchMove + const OnTouchStart + const OnTransitionEnd + const OnVolumeChange + const OnWaiting + const OnWheel + type PointerEvent struct + AltKey bool + Bubbles bool + Button int + Buttons int + Cancelable bool + ClientX int + ClientY int + Component EventTarget + Composed bool + CtrlKey bool + DefaultPrevented bool + Detail int + EventPhase int + Height int + IsPrimary bool + IsTrusted bool + MetaKey bool + MovementX int + MovementY int + OffsetX int + OffsetY int + PageX int + PageY int + PointerId int + PointerType string + Pressure int + RelatedTarget EventTarget + Source EventTarget + type Touch struct + ClientX int + ClientY int + Identifier int + PageX int + PageY int + RadiusX float64 + RadiusY float64 + RotationAngle int + ScreenX int + ScreenY int + Source EventTarget + type TouchEvent struct + ChangedTouches []Touch + Component EventTarget + LayerX int + LayerY int + PageX int + PageY int + Source EventTarget + TargetTouches []Touch + Touches []Touch + type Upload struct + ContentType string + FieldName string + FileName string + ID string + Path string + Size int64 + func EventUploads(ctx context.Context) ([]Upload, error) + type Writer struct + func (w *Writer) Write(p []byte) (n int, err error)