blob: 556847e6ecd9d642272f75635a3125b04ca61257 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
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.
type Message struct {
ID uint64
Channel uint8
Data []byte
}
// NewMessage returns a new Message.
func NewMessage(id uint64, ch uint8, data []byte) *Message {
return &Message{
ID: id,
Channel: ch,
Data: data,
}
}
|