aboutsummaryrefslogtreecommitdiff
path: root/message.go
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-02-10 15:03:55 +0100
committerOnur Gündüz <ogunduz@gmail.com>2026-02-10 15:03:55 +0100
commit4660317cbba12af5ae1546948785301e7f9108b4 (patch)
tree369de1c56b0dc774e2b6d9b29739601304688231 /message.go
parent3650f193abcee4dbc71922c6ecf59fcbcea3637b (diff)
downloadmuxer-4660317cbba12af5ae1546948785301e7f9108b4.tar.gz
muxer-4660317cbba12af5ae1546948785301e7f9108b4.zip
Naming
Diffstat (limited to 'message.go')
-rw-r--r--message.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/message.go b/message.go
index 556847e..fad8976 100644
--- a/message.go
+++ b/message.go
@@ -3,19 +3,19 @@ package binproto
// A Message represents a single binproto message.
//
// Each message starts with an header which is a varint encoded
-// unsigned 64-bit integer which consists of an ID (first 60-bits) and
-// a Channel number (last 4-bits), the rest of the message is payload.
+// 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.
type Message struct {
- ID uint64
- Channel uint8
- Data []byte
+ ID uint64
+ Type uint8
+ Data []byte
}
// NewMessage returns a new Message.
-func NewMessage(id uint64, ch uint8, data []byte) *Message {
+func NewMessage(id uint64, messageType uint8, data []byte) *Message {
return &Message{
- ID: id,
- Channel: ch,
- Data: data,
+ ID: id,
+ Type: messageType,
+ Data: data,
}
}