Documentation
¶
Overview ¶
Package msgproto_values demonstrates the same protocol as examples/msgproto using the untyped Values-based API instead of TypedFormat and TypedSchema.
Both examples produce identical wire bytes. The difference is entirely in how the Go side interacts with the codec:
- msgproto: TypedFormat[T] + TypedSchema[T] — struct fields, compiler-checked
- msgproto_values: frame.Format + schema.Schema — string keys, runtime-checked
The Values API is the right choice when the format is not known at compile time, when fields vary per connection, or when you want to keep the format declaration and the struct types independent.
Wire layout:
AA 55 | version(u8) | type(u8) | flags(u8) | length(u32LE) | payload | CRC32
Message types:
0x01 Ping — no payload; FlagPriority may be set 0x02 Data — payload: seq(u16BE) + data(var bytes) 0x03 DataAck — payload: seq(u16BE)
Run with:
go run lowbit.dev/wireframe/examples/msgproto_values
Click to show internal directories.
Click to hide internal directories.