aboutsummaryrefslogtreecommitdiff
path: root/message.go
diff options
context:
space:
mode:
Diffstat (limited to 'message.go')
-rw-r--r--message.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/message.go b/message.go
index fad8976..bc0a6e0 100644
--- a/message.go
+++ b/message.go
@@ -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