what

package
v0.500.0 Latest Latest
Warning

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

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

Documentation

Overview

Package what defines commands 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 (

	// Commands not associated with an Element
	Update   What // Used for update scheduling
	Reload        // Tells browser to reload the current URL
	Redirect      // Tells browser to load another URL
	Alert         // Display (if using Bootstrap) an alert message
	Order         // Re-order a set of elements
	Call          // Call JavaScript function
	Set           // Set JavaScript variable (path=json)

	// Element manipulation
	Inner   // Set the elements inner HTML
	Delete  // Delete the element
	Replace // Replace the element with new HTML
	Remove  // Remove child element (Data identifies child; Jid identifies parent)
	Insert  // Insert child element
	Append  // Append child element
	SAttr   // Set element attribute
	RAttr   // Remove element attribute
	SClass  // Set element class
	RClass  // Remove element class
	Value   // Set element value
	// Element input events
	Input       // Element value or input changed
	Click       // Element clicked
	ContextMenu // Context menu requested on element
	// Synchronous event-handler invocation. A real protocol command (used by
	// broadcasts as well as tests), not a test-only artifact.
	Hook // Calls the matching event handler synchronously
)

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