rpctypes

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertElemsToTransferElems

func ConvertElemsToTransferElems(elems []RenderedElem) ([]VDomTransferElem, []VDomText)

Types

type ModalConfig

type ModalConfig struct {
	ModalId    string `json:"modalid"`              // Unique identifier for the modal
	ModalType  string `json:"modaltype"`            // "alert" or "confirm"
	Icon       string `json:"icon,omitempty"`       // Optional icon to display (emoji or icon name)
	Title      string `json:"title"`                // Modal title
	Text       string `json:"text,omitempty"`       // Optional body text
	OkText     string `json:"oktext,omitempty"`     // Optional OK button text (defaults to "OK")
	CancelText string `json:"canceltext,omitempty"` // Optional Cancel button text for confirm modals (defaults to "Cancel")
}

ModalConfig contains all configuration options for modals

type ModalResult

type ModalResult struct {
	ModalId string `json:"modalid"` // ID of the modal
	Confirm bool   `json:"confirm"` // true = confirmed/ok, false = cancelled
}

ModalResult contains the result of a modal interaction

type RenderedElem

type RenderedElem struct {
	WaveId   string         `json:"waveid,omitempty"` // required, except for #text nodes
	Tag      string         `json:"tag"`
	Props    map[string]any `json:"props,omitempty"`
	Children []RenderedElem `json:"children,omitempty"`
	Text     string         `json:"text,omitempty"`
}

rendered element (output from rendering pipeline)

type VDomBackendOpts

type VDomBackendOpts struct {
	Title                string `json:"title,omitempty"`
	ShortDesc            string `json:"shortdesc,omitempty"`
	GlobalKeyboardEvents bool   `json:"globalkeyboardevents,omitempty"`
	FaviconPath          string `json:"faviconpath,omitempty"`
}

type VDomBackendUpdate

type VDomBackendUpdate struct {
	Type          string                  `json:"type" tstype:"\"backendupdate\""`
	Ts            int64                   `json:"ts"`
	ServerId      string                  `json:"serverid"`
	Opts          *VDomBackendOpts        `json:"opts,omitempty"`
	HasWork       bool                    `json:"haswork,omitempty"`
	FullUpdate    bool                    `json:"fullupdate,omitempty"`
	RenderUpdates []VDomRenderUpdate      `json:"renderupdates,omitempty"`
	TransferElems []VDomTransferElem      `json:"transferelems,omitempty"`
	TransferText  []VDomText              `json:"transfertext,omitempty"`
	RefOperations []vdom.VDomRefOperation `json:"refoperations,omitempty"`
	Messages      []VDomMessage           `json:"messages,omitempty"`
}

func (*VDomBackendUpdate) CreateTransferElems

func (beUpdate *VDomBackendUpdate) CreateTransferElems()

type VDomFrontendUpdate

type VDomFrontendUpdate struct {
	Type          string            `json:"type" tstype:"\"frontendupdate\""`
	Ts            int64             `json:"ts"`
	ClientId      string            `json:"clientid"`
	ForceTakeover bool              `json:"forcetakeover,omitempty"`
	CorrelationId string            `json:"correlationid,omitempty"`
	Reason        string            `json:"reason,omitempty"`
	Dispose       bool              `json:"dispose,omitempty"` // the vdom context was closed
	Resync        bool              `json:"resync,omitempty"`  // resync (send all backend data).  useful when the FE reloads
	RenderContext VDomRenderContext `json:"rendercontext,omitempty"`
	Events        []vdom.VDomEvent  `json:"events,omitempty"`
	RefUpdates    []VDomRefUpdate   `json:"refupdates,omitempty"`
	Messages      []VDomMessage     `json:"messages,omitempty"`
}

type VDomMessage

type VDomMessage struct {
	MessageType string `json:"messagetype"`
	Message     string `json:"message"`
	StackTrace  string `json:"stacktrace,omitempty"`
	Params      []any  `json:"params,omitempty"`
}

type VDomRefUpdate

type VDomRefUpdate struct {
	RefId      string                `json:"refid"`
	HasCurrent bool                  `json:"hascurrent"`
	Position   *vdom.VDomRefPosition `json:"position,omitempty"`
}

type VDomRenderContext

type VDomRenderContext struct {
	Focused    bool   `json:"focused"`
	Width      int    `json:"width"`
	Height     int    `json:"height"`
	RootRefId  string `json:"rootrefid"`
	Background bool   `json:"background,omitempty"`
}

type VDomRenderUpdate

type VDomRenderUpdate struct {
	UpdateType string        `json:"updatetype" tstype:"\"root\"|\"append\"|\"replace\"|\"remove\"|\"insert\""`
	WaveId     string        `json:"waveid,omitempty"`
	VDomWaveId string        `json:"vdomwaveid,omitempty"`
	VDom       *RenderedElem `json:"vdom,omitempty"` // these get removed for transfer (encoded to transferelems)
	Index      *int          `json:"index,omitempty"`
}

type VDomText

type VDomText struct {
	Id   int    `json:"id"`
	Text string `json:"text"`
}

type VDomTransferElem

type VDomTransferElem struct {
	WaveId   string         `json:"waveid,omitempty"` // required, except for #text nodes
	Tag      string         `json:"tag"`
	Props    map[string]any `json:"props,omitempty"`
	Children []string       `json:"children,omitempty"`
	Text     string         `json:"text,omitempty"`
}

the over the wire format for a vdom element

func DedupTransferElems

func DedupTransferElems(elems []VDomTransferElem) []VDomTransferElem

type VDomUrlRequestResponse

type VDomUrlRequestResponse struct {
	StatusCode int               `json:"statuscode,omitempty"`
	Headers    map[string]string `json:"headers,omitempty"`
	Body       []byte            `json:"body,omitempty"`
}

Jump to

Keyboard shortcuts

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