Documentation
¶
Index ¶
- Variables
- func ValidateAck(message *Ack) error
- func ValidateClientTelemetry(message *ClientTelemetry) error
- func ValidateError(message *Error) error
- func ValidateEvent(message *Event) error
- func ValidateEventField(message *EventField) error
- func ValidateFragmentUpdate(message *FragmentUpdate) error
- func ValidateFrame(message *Frame) error
- func ValidateHeartbeat(message *Heartbeat) error
- func ValidateOrigin(message *Origin) error
- func ValidatePatch(message *Patch) error
- func ValidateResyncRequest(message *ResyncRequest) error
- func ValidateSnapshot(message *Snapshot) error
- type Ack
- type ClientTelemetry
- func (*ClientTelemetry) Descriptor() ([]byte, []int)deprecated
- func (x *ClientTelemetry) GetApplyMicros() uint32
- func (x *ClientTelemetry) GetMorphMicros() uint32
- func (x *ClientTelemetry) GetPatchId() uint64
- func (*ClientTelemetry) ProtoMessage()
- func (x *ClientTelemetry) ProtoReflect() protoreflect.Message
- func (x *ClientTelemetry) Reset()
- func (x *ClientTelemetry) String() string
- type Error
- func (*Error) Descriptor() ([]byte, []int)deprecated
- func (x *Error) GetClientRef() uint64
- func (x *Error) GetCode() ErrorCode
- func (x *Error) GetEventId() uint64
- func (x *Error) GetFatal() bool
- func (x *Error) GetMessage() string
- func (*Error) ProtoMessage()
- func (x *Error) ProtoReflect() protoreflect.Message
- func (x *Error) Reset()
- func (x *Error) String() string
- type ErrorCode
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetClientRef() uint64
- func (x *Event) GetFields() []*EventField
- func (x *Event) GetFragmentId() string
- func (x *Event) GetName() string
- func (x *Event) GetSeenServerSeq() uint64
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- type EventField
- type FragmentUpdate
- func (*FragmentUpdate) Descriptor() ([]byte, []int)deprecated
- func (x *FragmentUpdate) GetFragmentId() string
- func (x *FragmentUpdate) GetHtml() string
- func (x *FragmentUpdate) GetOp() PatchOp
- func (*FragmentUpdate) ProtoMessage()
- func (x *FragmentUpdate) ProtoReflect() protoreflect.Message
- func (x *FragmentUpdate) Reset()
- func (x *FragmentUpdate) String() string
- type Frame
- func (*Frame) Descriptor() ([]byte, []int)deprecated
- func (x *Frame) GetAck() *Ack
- func (x *Frame) GetClientTelemetry() *ClientTelemetry
- func (x *Frame) GetError() *Error
- func (x *Frame) GetEvent() *Event
- func (x *Frame) GetHeartbeat() *Heartbeat
- func (x *Frame) GetPatch() *Patch
- func (x *Frame) GetPayload() isFrame_Payload
- func (x *Frame) GetProtocolVersion() uint32
- func (x *Frame) GetResyncRequest() *ResyncRequest
- func (x *Frame) GetSessionId() []byte
- func (x *Frame) GetSnapshot() *Snapshot
- func (*Frame) ProtoMessage()
- func (x *Frame) ProtoReflect() protoreflect.Message
- func (x *Frame) Reset()
- func (x *Frame) String() string
- type Frame_Ack
- type Frame_ClientTelemetry
- type Frame_Error
- type Frame_Event
- type Frame_Heartbeat
- type Frame_Patch
- type Frame_ResyncRequest
- type Frame_Snapshot
- type Heartbeat
- type Origin
- func (*Origin) Descriptor() ([]byte, []int)deprecated
- func (x *Origin) GetClientRef() uint64
- func (x *Origin) GetContributingEventIds() []uint64
- func (x *Origin) GetEventId() uint64
- func (x *Origin) GetKind() OriginKind
- func (x *Origin) GetSource() string
- func (*Origin) ProtoMessage()
- func (x *Origin) ProtoReflect() protoreflect.Message
- func (x *Origin) Reset()
- func (x *Origin) String() string
- type OriginKind
- type Patch
- func (*Patch) Descriptor() ([]byte, []int)deprecated
- func (x *Patch) GetOrigin() *Origin
- func (x *Patch) GetPatchId() uint64
- func (x *Patch) GetServerSeq() uint64
- func (x *Patch) GetStateVersion() uint64
- func (x *Patch) GetTransitionId() uint64
- func (x *Patch) GetUpdates() []*FragmentUpdate
- func (*Patch) ProtoMessage()
- func (x *Patch) ProtoReflect() protoreflect.Message
- func (x *Patch) Reset()
- func (x *Patch) String() string
- type PatchOp
- type ResyncReason
- func (ResyncReason) Descriptor() protoreflect.EnumDescriptor
- func (x ResyncReason) Enum() *ResyncReason
- func (ResyncReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x ResyncReason) Number() protoreflect.EnumNumber
- func (x ResyncReason) String() string
- func (ResyncReason) Type() protoreflect.EnumType
- type ResyncRequest
- func (*ResyncRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ResyncRequest) GetLastAppliedSeq() uint64
- func (x *ResyncRequest) GetReason() ResyncReason
- func (*ResyncRequest) ProtoMessage()
- func (x *ResyncRequest) ProtoReflect() protoreflect.Message
- func (x *ResyncRequest) Reset()
- func (x *ResyncRequest) String() string
- type Snapshot
- func (*Snapshot) Descriptor() ([]byte, []int)deprecated
- func (x *Snapshot) GetAckWindow() uint32
- func (x *Snapshot) GetHeartbeatIntervalMs() uint32
- func (x *Snapshot) GetMaxInboundFrameBytes() uint32
- func (x *Snapshot) GetOrigin() *Origin
- func (x *Snapshot) GetPatchId() uint64
- func (x *Snapshot) GetServerSeq() uint64
- func (x *Snapshot) GetStateVersion() uint64
- func (x *Snapshot) GetSupersededFromSeq() uint64
- func (x *Snapshot) GetSupersededThroughSeq() uint64
- func (x *Snapshot) GetTransitionId() uint64
- func (x *Snapshot) GetUpdates() []*FragmentUpdate
- func (*Snapshot) ProtoMessage()
- func (x *Snapshot) ProtoReflect() protoreflect.Message
- func (x *Snapshot) Reset()
- func (x *Snapshot) String() string
Constants ¶
This section is empty.
Variables ¶
var ( PatchOp_name = map[int32]string{ 0: "PATCH_OP_UNSPECIFIED", 1: "MORPH", 2: "APPEND", 3: "PREPEND", 4: "REMOVE", } PatchOp_value = map[string]int32{ "PATCH_OP_UNSPECIFIED": 0, "MORPH": 1, "APPEND": 2, "PREPEND": 3, "REMOVE": 4, } )
Enum value maps for PatchOp.
var ( OriginKind_name = map[int32]string{ 0: "ORIGIN_KIND_UNSPECIFIED", 1: "CLIENT_EVENT", 2: "EFFECT", 3: "TIMER", 4: "PUBSUB", 5: "MOUNT", 6: "RESYNC", } OriginKind_value = map[string]int32{ "ORIGIN_KIND_UNSPECIFIED": 0, "CLIENT_EVENT": 1, "EFFECT": 2, "TIMER": 3, "PUBSUB": 4, "MOUNT": 5, "RESYNC": 6, } )
Enum value maps for OriginKind.
var ( ResyncReason_name = map[int32]string{ 0: "RESYNC_REASON_UNSPECIFIED", 1: "GAP", 2: "RECONNECT", 3: "CLIENT_REQUEST", } ResyncReason_value = map[string]int32{ "RESYNC_REASON_UNSPECIFIED": 0, "GAP": 1, "RECONNECT": 2, "CLIENT_REQUEST": 3, } )
Enum value maps for ResyncReason.
var ( ErrorCode_name = map[int32]string{ 0: "ERROR_CODE_UNSPECIFIED", 1: "UNSUPPORTED_VERSION", 2: "UNAUTHORIZED", 3: "INVALID_FRAME", 4: "UNKNOWN_EVENT", 5: "UNKNOWN_FRAGMENT", 6: "RATE_LIMITED", 7: "INTERNAL", 8: "RESYNC_FAILED", } ErrorCode_value = map[string]int32{ "ERROR_CODE_UNSPECIFIED": 0, "UNSUPPORTED_VERSION": 1, "UNAUTHORIZED": 2, "INVALID_FRAME": 3, "UNKNOWN_EVENT": 4, "UNKNOWN_FRAGMENT": 5, "RATE_LIMITED": 6, "INTERNAL": 7, "RESYNC_FAILED": 8, } )
Enum value maps for ErrorCode.
var File_gotthlive_v1_frame_proto protoreflect.FileDescriptor
Functions ¶
func ValidateAck ¶
ValidateAck checks this message's annotated fields; it does not recurse. A failed predicate returns *liquidproto.Error. Nil input also returns an error.
func ValidateClientTelemetry ¶
func ValidateClientTelemetry(message *ClientTelemetry) error
ValidateClientTelemetry checks this message's annotated fields; it does not recurse. A failed predicate returns *liquidproto.Error. Nil input also returns an error.
func ValidateError ¶
ValidateError checks this message's annotated fields; it does not recurse. A failed predicate returns *liquidproto.Error. Nil input also returns an error.
func ValidateEvent ¶
ValidateEvent checks this message's annotated fields; it does not recurse. A failed predicate returns *liquidproto.Error. Nil input also returns an error.
func ValidateEventField ¶
func ValidateEventField(message *EventField) error
ValidateEventField checks this message's annotated fields; it does not recurse. A failed predicate returns *liquidproto.Error. Nil input also returns an error.
func ValidateFragmentUpdate ¶
func ValidateFragmentUpdate(message *FragmentUpdate) error
ValidateFragmentUpdate checks this message's annotated fields; it does not recurse. A failed predicate returns *liquidproto.Error. Nil input also returns an error.
func ValidateFrame ¶
ValidateFrame checks this message's annotated fields; it does not recurse. A failed predicate returns *liquidproto.Error. Nil input also returns an error.
func ValidateHeartbeat ¶
ValidateHeartbeat checks this message's annotated fields; it does not recurse. A failed predicate returns *liquidproto.Error. Nil input also returns an error.
func ValidateOrigin ¶
ValidateOrigin checks this message's annotated fields; it does not recurse. A failed predicate returns *liquidproto.Error. Nil input also returns an error.
func ValidatePatch ¶
ValidatePatch checks this message's annotated fields; it does not recurse. A failed predicate returns *liquidproto.Error. Nil input also returns an error.
func ValidateResyncRequest ¶
func ValidateResyncRequest(message *ResyncRequest) error
ValidateResyncRequest checks this message's annotated fields; it does not recurse. A failed predicate returns *liquidproto.Error. Nil input also returns an error.
func ValidateSnapshot ¶
ValidateSnapshot checks this message's annotated fields; it does not recurse. A failed predicate returns *liquidproto.Error. Nil input also returns an error.
Types ¶
type Ack ¶
type Ack struct {
ServerSeq uint64 `protobuf:"varint,1,opt,name=server_seq,json=serverSeq,proto3" json:"server_seq,omitempty"`
// contains filtered or unexported fields
}
Ack reports the highest contiguous server_seq the client has applied.
It is a cumulative high-water mark, which is why a dropped ack is harmless: the next one supersedes it and the outbound window re-opens one round trip later.
func (*Ack) Descriptor
deprecated
func (*Ack) GetServerSeq ¶
func (*Ack) ProtoMessage ¶
func (*Ack) ProtoMessage()
func (*Ack) ProtoReflect ¶
func (x *Ack) ProtoReflect() protoreflect.Message
type ClientTelemetry ¶
type ClientTelemetry struct {
PatchId uint64 `protobuf:"varint,1,opt,name=patch_id,json=patchId,proto3" json:"patch_id,omitempty"`
MorphMicros uint32 `protobuf:"varint,2,opt,name=morph_micros,json=morphMicros,proto3" json:"morph_micros,omitempty"`
ApplyMicros uint32 `protobuf:"varint,3,opt,name=apply_micros,json=applyMicros,proto3" json:"apply_micros,omitempty"`
// contains filtered or unexported fields
}
ClientTelemetry reports how long the browser took to apply a patch.
Every field here is untrusted input. patch_id must name a patch actually sent to this session (H-11) or the report is dropped and counted, and the durations are bounded so a fabricated value cannot skew a histogram to infinity.
func (*ClientTelemetry) Descriptor
deprecated
func (*ClientTelemetry) Descriptor() ([]byte, []int)
Deprecated: Use ClientTelemetry.ProtoReflect.Descriptor instead.
func (*ClientTelemetry) GetApplyMicros ¶
func (x *ClientTelemetry) GetApplyMicros() uint32
func (*ClientTelemetry) GetMorphMicros ¶
func (x *ClientTelemetry) GetMorphMicros() uint32
func (*ClientTelemetry) GetPatchId ¶
func (x *ClientTelemetry) GetPatchId() uint64
func (*ClientTelemetry) ProtoMessage ¶
func (*ClientTelemetry) ProtoMessage()
func (*ClientTelemetry) ProtoReflect ¶
func (x *ClientTelemetry) ProtoReflect() protoreflect.Message
func (*ClientTelemetry) Reset ¶
func (x *ClientTelemetry) Reset()
func (*ClientTelemetry) String ¶
func (x *ClientTelemetry) String() string
type Error ¶
type Error struct {
Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=gotthlive.v1.ErrorCode" json:"code,omitempty"`
// Operator-readable detail. In production this is generic; in dev mode it
// carries the stack. It never carries a token, a cookie, an authorization
// input, application state, or a raw frame body.
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
// The causal identifiers of the event this error concerns, or 0 when the
// error is not event-scoped (H-12).
EventId uint64 `protobuf:"varint,3,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
ClientRef uint64 `protobuf:"varint,4,opt,name=client_ref,json=clientRef,proto3" json:"client_ref,omitempty"`
// Whether the connection is closing. A close always names a code from the
// enumeration in docs/protocol.md §8.3; a close for an unenumerated reason
// is a defect.
Fatal bool `protobuf:"varint,5,opt,name=fatal,proto3" json:"fatal,omitempty"`
// contains filtered or unexported fields
}
Error reports a rejected frame or a failed transition.
func (*Error) Descriptor
deprecated
func (*Error) GetClientRef ¶
func (*Error) GetEventId ¶
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type ErrorCode ¶
type ErrorCode int32
ErrorCode is the machine-readable classification of an Error.
const ( ErrorCode_ERROR_CODE_UNSPECIFIED ErrorCode = 0 ErrorCode_UNSUPPORTED_VERSION ErrorCode = 1 ErrorCode_UNAUTHORIZED ErrorCode = 2 ErrorCode_INVALID_FRAME ErrorCode = 3 ErrorCode_UNKNOWN_EVENT ErrorCode = 4 ErrorCode_UNKNOWN_FRAGMENT ErrorCode = 5 ErrorCode_RATE_LIMITED ErrorCode = 6 ErrorCode_INTERNAL ErrorCode = 7 ErrorCode_RESYNC_FAILED ErrorCode = 8 )
func (ErrorCode) Descriptor ¶
func (ErrorCode) Descriptor() protoreflect.EnumDescriptor
func (ErrorCode) EnumDescriptor
deprecated
func (ErrorCode) Number ¶
func (x ErrorCode) Number() protoreflect.EnumNumber
func (ErrorCode) Type ¶
func (ErrorCode) Type() protoreflect.EnumType
type Event ¶
type Event struct {
// The client's own monotonic correlation handle, from 1 per connection.
//
// It is not the authoritative causal identifier: the server mints that and
// echoes this back in Origin, so no untrusted value ever enters provenance.
// A uint64 varint costs 1-3 bytes where a 128-bit identifier would cost 18,
// and the client runtime needs no identifier generator, which matters
// against a 12,288-byte budget.
ClientRef uint64 `protobuf:"varint,1,opt,name=client_ref,json=clientRef,proto3" json:"client_ref,omitempty"`
// The registered event name. An unregistered name is rejected and counted,
// never dispatched and never ignored.
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
// The fragment whose markup raised the event.
FragmentId string `protobuf:"bytes,3,opt,name=fragment_id,json=fragmentId,proto3" json:"fragment_id,omitempty"`
// The sequence number of the last patch the user had applied when they
// acted. This is the causation edge, and it is what makes a stale-view
// conflict detectable rather than silent. It is positive because the first
// Snapshot establishes server_seq = 1 and the client may send nothing before
// receiving it (H-10).
SeenServerSeq uint64 `protobuf:"varint,4,opt,name=seen_server_seq,json=seenServerSeq,proto3" json:"seen_server_seq,omitempty"`
// Form values. A repeated message is neither refined by the generated
// boundary nor bounded by it, so cardinality is H-4 and each element is
// refined explicitly.
Fields []*EventField `protobuf:"bytes,5,rep,name=fields,proto3" json:"fields,omitempty"`
// contains filtered or unexported fields
}
Event is one interaction raised by the browser.
func (*Event) Descriptor
deprecated
func (*Event) GetClientRef ¶
func (*Event) GetFields ¶
func (x *Event) GetFields() []*EventField
func (*Event) GetFragmentId ¶
func (*Event) GetSeenServerSeq ¶
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
type EventField ¶
type EventField struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// Bounded to fail early with a field-specific error. The authoritative limit
// on inbound size is H-5, enforced on the connection before any payload is
// allocated; this bound is subordinate defence in depth, not a redundant
// restatement of it, and removing it would cost the specific diagnostic.
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
// contains filtered or unexported fields
}
EventField is one form value.
func (*EventField) Descriptor
deprecated
func (*EventField) Descriptor() ([]byte, []int)
Deprecated: Use EventField.ProtoReflect.Descriptor instead.
func (*EventField) GetKey ¶
func (x *EventField) GetKey() string
func (*EventField) GetValue ¶
func (x *EventField) GetValue() string
func (*EventField) ProtoMessage ¶
func (*EventField) ProtoMessage()
func (*EventField) ProtoReflect ¶
func (x *EventField) ProtoReflect() protoreflect.Message
func (*EventField) Reset ¶
func (x *EventField) Reset()
func (*EventField) String ¶
func (x *EventField) String() string
type FragmentUpdate ¶
type FragmentUpdate struct {
FragmentId string `protobuf:"bytes,1,opt,name=fragment_id,json=fragmentId,proto3" json:"fragment_id,omitempty"`
Op PatchOp `protobuf:"varint,2,opt,name=op,proto3,enum=gotthlive.v1.PatchOp" json:"op,omitempty"`
// Rendered markup. A string rather than bytes, so protobuf's own UTF-8
// validation runs during Unmarshal — a free correctness check before the
// refinement boundary is even reached.
Html string `protobuf:"bytes,3,opt,name=html,proto3" json:"html,omitempty"`
// contains filtered or unexported fields
}
FragmentUpdate is the new markup for one live region.
func (*FragmentUpdate) Descriptor
deprecated
func (*FragmentUpdate) Descriptor() ([]byte, []int)
Deprecated: Use FragmentUpdate.ProtoReflect.Descriptor instead.
func (*FragmentUpdate) GetFragmentId ¶
func (x *FragmentUpdate) GetFragmentId() string
func (*FragmentUpdate) GetHtml ¶
func (x *FragmentUpdate) GetHtml() string
func (*FragmentUpdate) GetOp ¶
func (x *FragmentUpdate) GetOp() PatchOp
func (*FragmentUpdate) ProtoMessage ¶
func (*FragmentUpdate) ProtoMessage()
func (*FragmentUpdate) ProtoReflect ¶
func (x *FragmentUpdate) ProtoReflect() protoreflect.Message
func (*FragmentUpdate) Reset ¶
func (x *FragmentUpdate) Reset()
func (*FragmentUpdate) String ¶
func (x *FragmentUpdate) String() string
type Frame ¶
type Frame struct {
// Protocol version of the sender.
//
// The predicate rejects only the structurally impossible value. In proto3, 0
// is indistinguishable from unset, so a frame carrying it is malformed
// rather than merely old. There is deliberately no upper bound: a ceiling
// here would make a client above it fail as a malformed frame instead of as
// an unsupported version, putting the graceful path out of reach for exactly
// the field whose job is negotiating versions. Refinements reject what
// cannot be parsed; H-2 rejects what cannot be served, and says why.
ProtocolVersion uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
// Server-minted session identifier, 16 random bytes.
//
// It rides every frame, in both directions, so that one patch frame captured
// in isolation is resolvable. The width matches an OpenTelemetry trace ID.
// It rides inbound frames too, even though the connection already determines
// the session, because one envelope means one schema, one generated codec,
// one refinement boundary and one audit path on both sides — and because a
// direction-dependent predicate is inexpressible in a grammar with no free
// variables, so the alternative costs the totality of this bound.
SessionId []byte `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
// Exactly one payload. Members are messages, never scalars, because a scalar
// inside a oneof cannot be refined.
//
// Types that are valid to be assigned to Payload:
//
// *Frame_Event
// *Frame_Ack
// *Frame_ClientTelemetry
// *Frame_ResyncRequest
// *Frame_Patch
// *Frame_Snapshot
// *Frame_Error
// *Frame_Heartbeat
Payload isFrame_Payload `protobuf_oneof:"payload"`
// contains filtered or unexported fields
}
Frame is the one message on the wire, in both directions.
Field numbers 1..10 are deliberate: all of them fit a one-byte tag, which holds the envelope overhead to 22-23 bytes on every frame: 18 for the session identifier, 2 for the protocol version, and 2-3 for the payload's tag and length. It is a range because the payload length is.
func (*Frame) Descriptor
deprecated
func (*Frame) GetClientTelemetry ¶
func (x *Frame) GetClientTelemetry() *ClientTelemetry
func (*Frame) GetHeartbeat ¶
func (*Frame) GetPayload ¶
func (x *Frame) GetPayload() isFrame_Payload
func (*Frame) GetProtocolVersion ¶
func (*Frame) GetResyncRequest ¶
func (x *Frame) GetResyncRequest() *ResyncRequest
func (*Frame) GetSessionId ¶
func (*Frame) GetSnapshot ¶
func (*Frame) ProtoMessage ¶
func (*Frame) ProtoMessage()
func (*Frame) ProtoReflect ¶
func (x *Frame) ProtoReflect() protoreflect.Message
type Frame_ClientTelemetry ¶
type Frame_ClientTelemetry struct {
ClientTelemetry *ClientTelemetry `protobuf:"bytes,6,opt,name=client_telemetry,json=clientTelemetry,proto3,oneof"`
}
type Frame_Error ¶
type Frame_Error struct {
Error *Error `protobuf:"bytes,10,opt,name=error,proto3,oneof"`
}
type Frame_Event ¶
type Frame_Event struct {
// Client to server.
Event *Event `protobuf:"bytes,3,opt,name=event,proto3,oneof"`
}
type Frame_Heartbeat ¶
type Frame_Heartbeat struct {
// Both directions.
Heartbeat *Heartbeat `protobuf:"bytes,5,opt,name=heartbeat,proto3,oneof"`
}
type Frame_Patch ¶
type Frame_Patch struct {
// Server to client.
Patch *Patch `protobuf:"bytes,8,opt,name=patch,proto3,oneof"`
}
type Frame_ResyncRequest ¶
type Frame_ResyncRequest struct {
ResyncRequest *ResyncRequest `protobuf:"bytes,7,opt,name=resync_request,json=resyncRequest,proto3,oneof"`
}
type Frame_Snapshot ¶
type Frame_Snapshot struct {
Snapshot *Snapshot `protobuf:"bytes,9,opt,name=snapshot,proto3,oneof"`
}
type Heartbeat ¶
type Heartbeat struct {
Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
IntervalMs uint32 `protobuf:"varint,2,opt,name=interval_ms,json=intervalMs,proto3" json:"interval_ms,omitempty"`
// contains filtered or unexported fields
}
Heartbeat is the liveness signal, in both directions.
Liveness is this frame, not an RFC 6455 ping: the library never initiates ping or pong, so liveness is observable in the same capture as everything else. The server sets interval_ms; the client echoes both fields verbatim, which keeps the predicate total in both directions and doubles as an acknowledgement that the client honoured the interval.
func (*Heartbeat) Descriptor
deprecated
func (*Heartbeat) GetIntervalMs ¶
func (*Heartbeat) ProtoMessage ¶
func (*Heartbeat) ProtoMessage()
func (*Heartbeat) ProtoReflect ¶
func (x *Heartbeat) ProtoReflect() protoreflect.Message
type Origin ¶
type Origin struct {
Kind OriginKind `protobuf:"varint,1,opt,name=kind,proto3,enum=gotthlive.v1.OriginKind" json:"kind,omitempty"`
// The originating event, for client-caused patches. Zero for patches the
// server started on its own — a timer, a pubsub delivery, an effect result,
// or a mount — where `source` names the cause instead. A resync is the one
// server-sent frame with a specific nameable client cause, so it carries the
// request's identifiers rather than zeros. H-6 binds these two fields to the
// kind, which no predicate can express.
EventId uint64 `protobuf:"varint,2,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
ClientRef uint64 `protobuf:"varint,3,opt,name=client_ref,json=clientRef,proto3" json:"client_ref,omitempty"`
// What produced this patch, namespaced by convention: `event:<name>`,
// `effect:<source>`, `timer:<name>`, `pubsub:<topic>`, or the bare literals
// `mount` and `resync`.
//
// This is where a refinement does load-bearing product work. The requirement
// is that no patch may carry an unknown origin; the predicate below makes an
// origin-less patch unconstructable in Go and unparseable from the wire.
// That is the difference between a rule and a type.
//
// There is no registration step — a source is whatever an effect reports —
// so cardinality is bounded at the metric rather than at the schema: the
// label is capped at 64 distinct values per process, after which further
// values collapse to `other` and an overflow counter increments. Traces and
// the provenance log carry the full value.
Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"`
// Events whose state changes this patch carries but which were not
// individually patched, because coalescing collapsed them.
//
// Bounded by H-4 at 1,024. That bound is a flush trigger, never a
// truncation: at half the ceiling the actor emits the coalesced patch
// immediately rather than continuing to coalesce, so the list cannot
// overflow and no contributing event is ever dropped. Truncating would make
// the coalescing provenance property false silently, which is the worst of
// the available failures.
ContributingEventIds []uint64 `` /* 131-byte string literal not displayed */
// contains filtered or unexported fields
}
Origin says what caused a patch. Nothing is ever emitted without one.
func (*Origin) Descriptor
deprecated
func (*Origin) GetClientRef ¶
func (*Origin) GetContributingEventIds ¶
func (*Origin) GetEventId ¶
func (*Origin) GetKind ¶
func (x *Origin) GetKind() OriginKind
func (*Origin) ProtoMessage ¶
func (*Origin) ProtoMessage()
func (*Origin) ProtoReflect ¶
func (x *Origin) ProtoReflect() protoreflect.Message
type OriginKind ¶
type OriginKind int32
OriginKind is the category of cause behind a patch.
const ( OriginKind_ORIGIN_KIND_UNSPECIFIED OriginKind = 0 OriginKind_CLIENT_EVENT OriginKind = 1 OriginKind_EFFECT OriginKind = 2 OriginKind_TIMER OriginKind = 3 OriginKind_PUBSUB OriginKind = 4 OriginKind_MOUNT OriginKind = 5 OriginKind_RESYNC OriginKind = 6 )
func (OriginKind) Descriptor ¶
func (OriginKind) Descriptor() protoreflect.EnumDescriptor
func (OriginKind) Enum ¶
func (x OriginKind) Enum() *OriginKind
func (OriginKind) EnumDescriptor
deprecated
func (OriginKind) EnumDescriptor() ([]byte, []int)
Deprecated: Use OriginKind.Descriptor instead.
func (OriginKind) Number ¶
func (x OriginKind) Number() protoreflect.EnumNumber
func (OriginKind) String ¶
func (x OriginKind) String() string
func (OriginKind) Type ¶
func (OriginKind) Type() protoreflect.EnumType
type Patch ¶
type Patch struct {
ServerSeq uint64 `protobuf:"varint,1,opt,name=server_seq,json=serverSeq,proto3" json:"server_seq,omitempty"`
PatchId uint64 `protobuf:"varint,2,opt,name=patch_id,json=patchId,proto3" json:"patch_id,omitempty"`
TransitionId uint64 `protobuf:"varint,3,opt,name=transition_id,json=transitionId,proto3" json:"transition_id,omitempty"`
StateVersion uint64 `protobuf:"varint,4,opt,name=state_version,json=stateVersion,proto3" json:"state_version,omitempty"`
Origin *Origin `protobuf:"bytes,5,opt,name=origin,proto3" json:"origin,omitempty"`
Updates []*FragmentUpdate `protobuf:"bytes,6,rep,name=updates,proto3" json:"updates,omitempty"`
// contains filtered or unexported fields
}
Patch carries the complete rendered HTML of each changed fragment.
There is no server-side diff of consecutive renders: the diff that matters happens in the browser, against the live DOM, and a server-side copy of what the server believes the browser shows is a second source of truth that can drift.
func (*Patch) Descriptor
deprecated
func (*Patch) GetPatchId ¶
func (*Patch) GetServerSeq ¶
func (*Patch) GetStateVersion ¶
func (*Patch) GetTransitionId ¶
func (*Patch) GetUpdates ¶
func (x *Patch) GetUpdates() []*FragmentUpdate
func (*Patch) ProtoMessage ¶
func (*Patch) ProtoMessage()
func (*Patch) ProtoReflect ¶
func (x *Patch) ProtoReflect() protoreflect.Message
type PatchOp ¶
type PatchOp int32
PatchOp is how a fragment update is applied to the DOM.
func (PatchOp) Descriptor ¶
func (PatchOp) Descriptor() protoreflect.EnumDescriptor
func (PatchOp) EnumDescriptor
deprecated
func (PatchOp) Number ¶
func (x PatchOp) Number() protoreflect.EnumNumber
func (PatchOp) Type ¶
func (PatchOp) Type() protoreflect.EnumType
type ResyncReason ¶
type ResyncReason int32
ResyncReason is why the client asked for a full re-render.
const ( ResyncReason_RESYNC_REASON_UNSPECIFIED ResyncReason = 0 ResyncReason_GAP ResyncReason = 1 ResyncReason_RECONNECT ResyncReason = 2 ResyncReason_CLIENT_REQUEST ResyncReason = 3 )
func (ResyncReason) Descriptor ¶
func (ResyncReason) Descriptor() protoreflect.EnumDescriptor
func (ResyncReason) Enum ¶
func (x ResyncReason) Enum() *ResyncReason
func (ResyncReason) EnumDescriptor
deprecated
func (ResyncReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use ResyncReason.Descriptor instead.
func (ResyncReason) Number ¶
func (x ResyncReason) Number() protoreflect.EnumNumber
func (ResyncReason) String ¶
func (x ResyncReason) String() string
func (ResyncReason) Type ¶
func (ResyncReason) Type() protoreflect.EnumType
type ResyncRequest ¶
type ResyncRequest struct {
LastAppliedSeq uint64 `protobuf:"varint,1,opt,name=last_applied_seq,json=lastAppliedSeq,proto3" json:"last_applied_seq,omitempty"`
Reason ResyncReason `protobuf:"varint,2,opt,name=reason,proto3,enum=gotthlive.v1.ResyncReason" json:"reason,omitempty"`
// contains filtered or unexported fields
}
ResyncRequest asks the server to re-render everything.
It is the one client frame that triggers a full re-render, so it is rate limited in a bucket of its own, independent of the event budget (H-14). A request whose last_applied_seq already equals the current server_seq describes no gap and is answered with an Ack rather than a Snapshot.
func (*ResyncRequest) Descriptor
deprecated
func (*ResyncRequest) Descriptor() ([]byte, []int)
Deprecated: Use ResyncRequest.ProtoReflect.Descriptor instead.
func (*ResyncRequest) GetLastAppliedSeq ¶
func (x *ResyncRequest) GetLastAppliedSeq() uint64
func (*ResyncRequest) GetReason ¶
func (x *ResyncRequest) GetReason() ResyncReason
func (*ResyncRequest) ProtoMessage ¶
func (*ResyncRequest) ProtoMessage()
func (*ResyncRequest) ProtoReflect ¶
func (x *ResyncRequest) ProtoReflect() protoreflect.Message
func (*ResyncRequest) Reset ¶
func (x *ResyncRequest) Reset()
func (*ResyncRequest) String ¶
func (x *ResyncRequest) String() string
type Snapshot ¶
type Snapshot struct {
ServerSeq uint64 `protobuf:"varint,1,opt,name=server_seq,json=serverSeq,proto3" json:"server_seq,omitempty"`
PatchId uint64 `protobuf:"varint,2,opt,name=patch_id,json=patchId,proto3" json:"patch_id,omitempty"`
TransitionId uint64 `protobuf:"varint,3,opt,name=transition_id,json=transitionId,proto3" json:"transition_id,omitempty"`
StateVersion uint64 `protobuf:"varint,4,opt,name=state_version,json=stateVersion,proto3" json:"state_version,omitempty"`
Origin *Origin `protobuf:"bytes,5,opt,name=origin,proto3" json:"origin,omitempty"`
// Session parameters, sent once so the client needs no configuration.
HeartbeatIntervalMs uint32 `protobuf:"varint,6,opt,name=heartbeat_interval_ms,json=heartbeatIntervalMs,proto3" json:"heartbeat_interval_ms,omitempty"`
MaxInboundFrameBytes uint32 `` /* 126-byte string literal not displayed */
AckWindow uint32 `protobuf:"varint,8,opt,name=ack_window,json=ackWindow,proto3" json:"ack_window,omitempty"`
Updates []*FragmentUpdate `protobuf:"bytes,9,rep,name=updates,proto3" json:"updates,omitempty"`
// The supersession edge: the inclusive server_seq range this snapshot
// replaces.
//
// Without it, an analyst holding a wire capture cannot say which events
// produced the DOM the user is now looking at across a resync boundary — the
// superseded patches were emitted and counted, then dropped, and the
// snapshot that replaced them named none of them. A range rather than the
// union of contributing event identifiers, because the union is unbounded
// and would collide with H-4, while the range is two varints, is exact, and
// is sufficient: the superseded patches are themselves in the capture, so
// walking the range recovers the event set.
//
// Both are 0 on a session's first snapshot and both are non-zero on a resync
// snapshot; the zero case is legitimate, which is why no predicate can carry
// this and H-13 does instead.
SupersededFromSeq uint64 `protobuf:"varint,10,opt,name=superseded_from_seq,json=supersededFromSeq,proto3" json:"superseded_from_seq,omitempty"`
SupersededThroughSeq uint64 `protobuf:"varint,11,opt,name=superseded_through_seq,json=supersededThroughSeq,proto3" json:"superseded_through_seq,omitempty"`
// contains filtered or unexported fields
}
Snapshot carries every registered fragment and the session's parameters.
It is the first frame on every connection and the answer to every resync. Nothing is serialized to produce it: state never leaves the server in any form. A reconnect after a deploy is indistinguishable from any other reconnect, because no state format crosses a version boundary and so none can fail to migrate.
func (*Snapshot) Descriptor
deprecated
func (*Snapshot) GetAckWindow ¶
func (*Snapshot) GetHeartbeatIntervalMs ¶
func (*Snapshot) GetMaxInboundFrameBytes ¶
func (*Snapshot) GetPatchId ¶
func (*Snapshot) GetServerSeq ¶
func (*Snapshot) GetStateVersion ¶
func (*Snapshot) GetSupersededFromSeq ¶
func (*Snapshot) GetSupersededThroughSeq ¶
func (*Snapshot) GetTransitionId ¶
func (*Snapshot) GetUpdates ¶
func (x *Snapshot) GetUpdates() []*FragmentUpdate
func (*Snapshot) ProtoMessage ¶
func (*Snapshot) ProtoMessage()
func (*Snapshot) ProtoReflect ¶
func (x *Snapshot) ProtoReflect() protoreflect.Message