what

package
v0.502.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package what defines the commands and events used by the JaWS wire protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type What

type What uint8

What identifies a JaWS wire protocol command or event.

const (

	// Update schedules dirty element processing.
	Update What
	// Reload tells the browser to reload the current URL.
	Reload
	// Redirect tells the browser to load another URL.
	Redirect
	// Alert displays an alert message when the client UI supports it.
	Alert
	// Order reorders a set of elements.
	Order
	// Call calls a JavaScript function.
	Call
	// Set sets a JavaScript variable as path=json.
	Set

	// Inner sets the element's inner HTML.
	Inner
	// Delete deletes the element.
	Delete
	// Replace replaces the element with new HTML.
	Replace
	// Remove removes a child element; Data identifies child and Jid identifies parent.
	Remove
	// Insert inserts a child element.
	Insert
	// Append appends a child element.
	Append
	// SAttr sets an element attribute.
	SAttr
	// RAttr removes an element attribute.
	RAttr
	// SClass sets an element class.
	SClass
	// RClass removes an element class.
	RClass
	// Value sets an element value.
	Value

	// Input reports that an element value or input changed.
	Input
	// Click reports that an element was clicked.
	Click
	// ContextMenu reports that a context menu was requested on an element.
	ContextMenu

	// Hook calls the matching event handler synchronously.
	Hook
)

func Parse

func Parse(s string) What

Parse returns the What named by s.

Matching is exact and case-sensitive: s must equal a command or event name as produced by What.String, matching what the JaWS client sends on the wire. An empty string is treated as Update. Unknown strings, as well as the names of the internal boundary markers (which are not valid commands or events), return the invalid zero value.

func (What) IsCommand

func (w What) IsCommand() bool

IsCommand reports whether w is a non-element command.

func (What) IsValid

func (w What) IsValid() bool

IsValid reports whether w is a known command or event.

func (What) String

func (i What) String() string

Jump to

Keyboard shortcuts

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