Versions in this module Expand all Collapse all v0 v0.2.4 May 24, 2026 v0.2.3 May 24, 2026 v0.2.2 May 23, 2026 v0.2.1 May 14, 2026 v0.2.0 May 12, 2026 Changes in this version type Patch + PreserveScroll bool v0.1.0 Apr 2, 2026 Changes in this version type ClientHello + ClientHash string type SubmitEventData + Submitter *SubmitterInfo + type SubmitterInfo struct + Name string + Value string v0.0.3 Mar 10, 2026 Changes in this version + const HandshakeRecoveryFlagClearResume + func NewShellRelay(message string) (ControlType, *ShellRelay) type ControlType + const ControlShellRelay + type HandshakeRecoveryAction uint8 + const HandshakeRecoveryReloadOnce + const HandshakeRecoveryRetry + const HandshakeRecoveryStop + const HandshakeRecoveryUnknown + func (a HandshakeRecoveryAction) String() string type ServerHello + ClearResume bool + RecoveryAction HandshakeRecoveryAction + RecoveryActionSet bool + func (sh *ServerHello) WithRecovery(action HandshakeRecoveryAction, clearResume bool) *ServerHello + type ShellRelay struct + Message string v0.0.2 Mar 6, 2026 v0.0.1 Feb 24, 2026 Changes in this version + const DefaultMaxAllocation + const DefaultWindow + const FrameHeaderSize + const HardMaxAllocation + const MaxCollectionCount + const MaxFrameSize + const MaxHookDepth + const MaxPatchDepth + const MaxPayloadSize + const MaxVNodeDepth + const MaxVarintLen + const ServerFlagBinaryBlobs + const ServerFlagCompression + const ServerFlagStreaming + var CurrentVersion = ProtocolVersion + var ErrAllocationTooLarge = errors.New("protocol: allocation size exceeds limit") + var ErrBufferTooShort = errors.New("protocol: buffer too short") + var ErrCollectionTooLarge = errors.New("protocol: collection count exceeds limit") + var ErrFrameTooLarge = errors.New("protocol: frame payload too large") + var ErrInvalidBool = errors.New("protocol: invalid boolean value") + var ErrInvalidEventType = errors.New("protocol: invalid event type") + var ErrInvalidFrameType = errors.New("protocol: invalid frame type") + var ErrInvalidPayload = errors.New("protocol: invalid event payload") + var ErrMaxDepthExceeded = errors.New("protocol: maximum nesting depth exceeded") + var ErrTrailingFrameData = errors.New("protocol: trailing bytes after frame payload") + var ErrVarintOverflow = errors.New("protocol: varint overflow") + func CompareProtocolVersion(a, b ProtocolVersion) int + func DecodeFrameHeader(data []byte) (FrameType, FrameFlags, int, error) + func DecodeSvarint(buf []byte) (int64, int) + func DecodeUvarint(buf []byte) (uint64, int) + func EncodeAck(ack *Ack) []byte + func EncodeAckTo(e *Encoder, ack *Ack) + func EncodeClientHello(ch *ClientHello) []byte + func EncodeClientHelloTo(e *Encoder, ch *ClientHello) + func EncodeControl(ct ControlType, payload any) []byte + func EncodeControlTo(e *Encoder, ct ControlType, payload any) + func EncodeErrorMessage(em *ErrorMessage) []byte + func EncodeErrorMessageTo(e *Encoder, em *ErrorMessage) + func EncodeEvent(e *Event) []byte + func EncodeEventTo(enc *Encoder, e *Event) + func EncodePatches(pf *PatchesFrame) []byte + func EncodePatchesTo(e *Encoder, pf *PatchesFrame) + func EncodeServerHello(sh *ServerHello) []byte + func EncodeServerHelloTo(e *Encoder, sh *ServerHello) + func EncodeSvarint(buf []byte, v int64) int + func EncodeUvarint(buf []byte, v uint64) int + func EncodeVNodeWire(e *Encoder, node *VNodeWire) + func NewAuthCommand(cmd *AuthCommand) (ControlType, *AuthCommand) + func NewClose(reason CloseReason, message string) (ControlType, *CloseMessage) + func NewHookRevert(hid string) (ControlType, *HookRevert) + func NewPing(timestamp uint64) (ControlType, *PingPong) + func NewPong(timestamp uint64) (ControlType, *PingPong) + func NewResyncFull(html string) (ControlType, *ResyncResponse) + func NewResyncPatches(fromSeq uint64, patches []Patch) (ControlType, *ResyncResponse) + func NewResyncRequest(lastSeq uint64) (ControlType, *ResyncRequest) + func NewSessionRefresh(cmd *SessionRefreshCommand) (ControlType, *SessionRefreshCommand) + func NewSessionRefreshAck(source string) (ControlType, *SessionRefreshAck) + func SvarintLen(v int64) int + func UvarintLen(v uint64) int + func WriteFrame(w io.Writer, f *Frame) error + type Ack struct + LastSeq uint64 + Window uint64 + func DecodeAck(data []byte) (*Ack, error) + func DecodeAckFrom(d *Decoder) (*Ack, error) + func NewAck(lastSeq, window uint64) *Ack + type AnimationEventData struct + AnimationName string + ElapsedTime float64 + PseudoElement string + type AuthAction uint8 + const AuthActionBroadcast + const AuthActionForceReload + const AuthActionHardNavigate + type AuthCommand struct + Action AuthAction + Channel string + Path string + Reason uint8 + Type string + type BannerSpec struct + CSSClass string + Detail string + DismissMS uint16 + Message string + type ClientHello struct + CSRFToken string + LastSeq uint32 + SessionID string + TZOffset int16 + Version ProtocolVersion + ViewportH uint16 + ViewportW uint16 + func DecodeClientHello(data []byte) (*ClientHello, error) + func DecodeClientHelloFrom(d *Decoder) (*ClientHello, error) + func NewClientHello(csrfToken string) *ClientHello + type CloseMessage struct + Message string + Reason CloseReason + type CloseReason uint8 + const CloseError + const CloseGoingAway + const CloseNormal + const CloseServerShutdown + const CloseSessionExpired + func (cr CloseReason) String() string + type ControlType uint8 + const ControlAuthCommand + const ControlClose + const ControlHookRevert + const ControlPing + const ControlPong + const ControlResyncFull + const ControlResyncPatches + const ControlResyncRequest + const ControlSessionRefresh + const ControlSessionRefreshAck + func DecodeControl(data []byte) (ControlType, any, error) + func DecodeControlFrom(d *Decoder) (ControlType, any, error) + func (ct ControlType) String() string + type CustomEventData struct + Data []byte + Name string + type Decoder struct + func NewDecoder(buf []byte) *Decoder + func (d *Decoder) EOF() bool + func (d *Decoder) Position() int + func (d *Decoder) ReadBool() (bool, error) + func (d *Decoder) ReadByte() (byte, error) + func (d *Decoder) ReadBytes(n int) ([]byte, error) + func (d *Decoder) ReadCollectionCount() (int, error) + func (d *Decoder) ReadFloat32() (float32, error) + func (d *Decoder) ReadFloat64() (float64, error) + func (d *Decoder) ReadInt16() (int16, error) + func (d *Decoder) ReadInt32() (int32, error) + func (d *Decoder) ReadInt64() (int64, error) + func (d *Decoder) ReadLenBytes() ([]byte, error) + func (d *Decoder) ReadString() (string, error) + func (d *Decoder) ReadSvarint() (int64, error) + func (d *Decoder) ReadUint16() (uint16, error) + func (d *Decoder) ReadUint32() (uint32, error) + func (d *Decoder) ReadUint64() (uint64, error) + func (d *Decoder) ReadUvarint() (uint64, error) + func (d *Decoder) Remaining() int + func (d *Decoder) Skip(n int) error + type DepthLimits struct + HookDepth int + PatchDepth int + VNodeDepth int + func DefaultDepthLimits() *DepthLimits + type Encoder struct + func NewEncoder() *Encoder + func NewEncoderWithCap(cap int) *Encoder + func (e *Encoder) Bytes() []byte + func (e *Encoder) Len() int + func (e *Encoder) Reset() + func (e *Encoder) WriteBool(b bool) + func (e *Encoder) WriteByte(b byte) error + func (e *Encoder) WriteByteUnsafe(b byte) + func (e *Encoder) WriteBytes(b []byte) + func (e *Encoder) WriteFloat32(v float32) + func (e *Encoder) WriteFloat64(v float64) + func (e *Encoder) WriteInt16(v int16) + func (e *Encoder) WriteInt32(v int32) + func (e *Encoder) WriteInt64(v int64) + func (e *Encoder) WriteLenBytes(b []byte) + func (e *Encoder) WriteString(s string) + func (e *Encoder) WriteSvarint(v int64) + func (e *Encoder) WriteUint16(v uint16) + func (e *Encoder) WriteUint32(v uint32) + func (e *Encoder) WriteUint64(v uint64) + func (e *Encoder) WriteUvarint(v uint64) + type ErrorCode uint16 + const ErrHandlerNotFound + const ErrHandlerPanic + const ErrInvalidEvent + const ErrInvalidFrame + const ErrNotAuthorized + const ErrNotFound + const ErrRateLimited + const ErrRouteError + const ErrServerError + const ErrSessionExpired + const ErrUnknown + const ErrValidation + func (ec ErrorCode) String() string + type ErrorMessage struct + Code ErrorCode + Fatal bool + Message string + func DecodeErrorMessage(data []byte) (*ErrorMessage, error) + func DecodeErrorMessageFrom(d *Decoder) (*ErrorMessage, error) + func NewError(code ErrorCode, message string) *ErrorMessage + func NewFatalError(code ErrorCode, message string) *ErrorMessage + func (em *ErrorMessage) Error() string + func (em *ErrorMessage) IsFatal() bool + type Event struct + HID string + Payload any + Seq uint64 + Type EventType + func DecodeEvent(data []byte) (*Event, error) + func DecodeEventFrom(d *Decoder) (*Event, error) + type EventType uint8 + const EventAnimationCancel + const EventAnimationEnd + const EventAnimationIteration + const EventAnimationStart + const EventBlur + const EventChange + const EventClick + const EventCustom + const EventDblClick + const EventDragEnd + const EventDragStart + const EventDrop + const EventFocus + const EventHook + const EventInput + const EventKeyDown + const EventKeyPress + const EventKeyUp + const EventMouseDown + const EventMouseEnter + const EventMouseLeave + const EventMouseMove + const EventMouseUp + const EventNavigate + const EventResize + const EventScroll + const EventSubmit + const EventTouchEnd + const EventTouchMove + const EventTouchStart + const EventTransitionCancel + const EventTransitionEnd + const EventTransitionRun + const EventTransitionStart + const EventWheel + func (et EventType) String() string + type Frame struct + Flags FrameFlags + Payload []byte + Type FrameType + func DecodeFrame(data []byte) (*Frame, error) + func NewFrame(ft FrameType, payload []byte) *Frame + func NewFrameWithFlags(ft FrameType, flags FrameFlags, payload []byte) *Frame + func ReadFrame(r io.Reader) (*Frame, error) + func (f *Frame) Encode() []byte + func (f *Frame) EncodeTo(e *Encoder) + type FrameFlags uint8 + const FlagCompressed + const FlagFinal + const FlagPriority + const FlagSequenced + func (ff FrameFlags) Has(flag FrameFlags) bool + type FrameType uint8 + const FrameAck + const FrameControl + const FrameError + const FrameEvent + const FrameHandshake + const FramePatches + func (ft FrameType) String() string + type HandshakeStatus uint8 + const HandshakeInternalError + const HandshakeInvalidCSRF + const HandshakeInvalidFormat + const HandshakeLimitExceeded + const HandshakeNotAuthorized + const HandshakeOK + const HandshakeSchemaMismatch + const HandshakeServerBusy + const HandshakeSessionExpired + const HandshakeUpgradeRequired + const HandshakeVersionMismatch + func HandshakeStatusForVersion(client, server ProtocolVersion) HandshakeStatus + func (hs HandshakeStatus) String() string + type HookEventData struct + Data map[string]any + Name string + type HookRevert struct + HID string + type HookValueType uint8 + const HookValueArray + const HookValueBool + const HookValueFloat + const HookValueInt + const HookValueNull + const HookValueObject + const HookValueString + type InputEventData struct + Data string + InputType string + Value string + type KeyboardEventData struct + Code string + Key string + Location uint8 + Modifiers Modifiers + Repeat bool + type Modifiers uint8 + const ModAlt + const ModCtrl + const ModMeta + const ModShift + func (m Modifiers) Has(mod Modifiers) bool + type MouseEventData struct + Button uint8 + Buttons uint8 + ClientX int + ClientY int + Modifiers Modifiers + OffsetX int + OffsetY int + PageX int + PageY int + type NavigateEventData struct + Path string + Replace bool + type Patch struct + Behavior ScrollBehavior + Bool bool + HID string + Index int + Key string + Node *VNodeWire + Op PatchOp + Params map[string]string + ParentID string + Path string + Value string + X int + Y int + func NewAddClassPatch(hid, class string) Patch + func NewBlurPatch(hid string) Patch + func NewDispatchPatch(hid, eventName, detail string) Patch + func NewFocusPatch(hid string) Patch + func NewInsertNodePatch(hid, parentID string, index int, node *VNodeWire) Patch + func NewMoveNodePatch(hid, parentID string, index int) Patch + func NewNavPushPatch(path string) Patch + func NewNavReplacePatch(path string) Patch + func NewRemoveAttrPatch(hid, key string) Patch + func NewRemoveClassPatch(hid, class string) Patch + func NewRemoveNodeAtPatch(parentID string, index int) Patch + func NewRemoveNodePatch(hid string) Patch + func NewRemoveStylePatch(hid, property string) Patch + func NewReplaceNodeAtPatch(parentID string, index int, node *VNodeWire) Patch + func NewReplaceNodePatch(hid string, node *VNodeWire) Patch + func NewScrollToPatch(hid string, x, y int, behavior ScrollBehavior) Patch + func NewSetAttrPatch(hid, key, value string) Patch + func NewSetCheckedPatch(hid string, checked bool) Patch + func NewSetDataPatch(hid, key, value string) Patch + func NewSetSelectedPatch(hid string, selected bool) Patch + func NewSetStylePatch(hid, property, value string) Patch + func NewSetTextAtPatch(parentID string, index int, text string) Patch + func NewSetTextPatch(hid, text string) Patch + func NewSetValuePatch(hid, value string) Patch + func NewToggleClassPatch(hid, class string) Patch + func NewURLPushPatch(params map[string]string) Patch + func NewURLReplacePatch(params map[string]string) Patch + type PatchOp uint8 + const PatchAddClass + const PatchBlur + const PatchDispatch + const PatchFocus + const PatchInsertNode + const PatchMoveNode + const PatchNavPush + const PatchNavReplace + const PatchRemoveAttr + const PatchRemoveClass + const PatchRemoveNode + const PatchRemoveNodeAt + const PatchRemoveStyle + const PatchReplaceNode + const PatchReplaceNodeAt + const PatchScrollTo + const PatchSetAttr + const PatchSetChecked + const PatchSetData + const PatchSetSelected + const PatchSetStyle + const PatchSetText + const PatchSetTextAt + const PatchSetValue + const PatchToggleClass + const PatchURLPush + const PatchURLReplace + func (op PatchOp) String() string + type PatchesFrame struct + Patches []Patch + Seq uint64 + func DecodePatches(data []byte) (*PatchesFrame, error) + func DecodePatchesFrom(d *Decoder) (*PatchesFrame, error) + type PingPong struct + Timestamp uint64 + type ProtocolVersion struct + Major uint8 + Minor uint8 + type ResizeEventData struct + Height int + Width int + type ResyncRequest struct + LastSeq uint64 + type ResyncResponse struct + FromSeq uint64 + HTML string + Patches []Patch + Type ControlType + type SchemaRefreshReason uint8 + const SchemaRefreshColdDeploy + const SchemaRefreshHashMismatch + const SchemaRefreshIDRemoved + const SchemaRefreshIDTypeChanged + const SchemaRefreshRuntimeViolation + const SchemaRefreshUnknown + func (sr SchemaRefreshReason) String() string + type ScrollBehavior uint8 + const ScrollInstant + const ScrollSmooth + type ScrollEventData struct + ScrollLeft int + ScrollTop int + type ServerHello struct + AuthReason uint8 + AuthReasonSet bool + BannerCSSClass string + BannerDetail string + BannerDismissMS uint16 + BannerMessage string + BannerSet bool + Flags uint16 + NextSeq uint32 + SchemaReason SchemaRefreshReason + SchemaReasonSet bool + ServerTime uint64 + SessionID string + Status HandshakeStatus + func DecodeServerHello(data []byte) (*ServerHello, error) + func DecodeServerHelloFrom(d *Decoder) (*ServerHello, error) + func NewServerHello(sessionID string, nextSeq uint32, serverTime uint64) *ServerHello + func NewServerHelloError(status HandshakeStatus) *ServerHello + func NewServerHelloErrorWithReason(status HandshakeStatus, reason uint8) *ServerHello + func NewServerHelloSchemaError(reason SchemaRefreshReason, banner BannerSpec) *ServerHello + type SessionRefreshAck struct + Source string + type SessionRefreshCommand struct + CSSClass string + DelayMS uint16 + Detail string + DevMode bool + Message string + Reason SchemaRefreshReason + type SubmitEventData struct + Fields map[string]string + type TouchEventData struct + ChangedTouches []TouchPoint + TargetTouches []TouchPoint + Touches []TouchPoint + type TouchPoint struct + ClientX int + ClientY int + ID int + PageX int + PageY int + type TransitionEventData struct + ElapsedTime float64 + PropertyName string + PseudoElement string + type VNodeWire struct + Attrs map[string]string + Children []*VNodeWire + HID string + Kind vdom.VKind + Tag string + Text string + func DecodeVNodeWire(d *Decoder) (*VNodeWire, error) + func NewElementWire(tag string, attrs map[string]string, children ...*VNodeWire) *VNodeWire + func NewFragmentWire(children ...*VNodeWire) *VNodeWire + func NewRawWire(html string) *VNodeWire + func NewTextWire(text string) *VNodeWire + func VNodeToWire(node *vdom.VNode) *VNodeWire + func VNodeToWireWithPolicy(node *vdom.VNode, policy vdom.URLPolicy) *VNodeWire + func (w *VNodeWire) ToVNode() *vdom.VNode + type WheelEventData struct + ClientX int + ClientY int + DeltaMode uint8 + DeltaX float64 + DeltaY float64 + DeltaZ float64 + Modifiers Modifiers