diff options
Diffstat (limited to 'message.go')
| -rw-r--r-- | message.go | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1,10 +1,13 @@ -package binproto +package muxer -// A Message represents a single binproto message. +// Message represents a single protocol message with a channel ID, type, and payload. // -// Each message starts with an header which is a varint encoded -// unsigned 64-bit integer which consists of a channel ID (first 60-bits) and -// a message type (last 4-bits), the rest of the message is payload. +// ┌──────────────────────────────────────────────┐ +// │ length | channel ID × message type │ payload │ +// └──────────────────────────────────────────────┘ +// +// Each message starts with a varint encoded unsigned 64-bit integer which consists of +// a channel ID (first 60-bits) and a message type (last 4-bits) followed by the payload. type Message struct { ID uint64 Type uint8 |
