aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/message.go
blob: 21cf163e6e661d5e862a96a2f47e48f3f094fbff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package whisper

type Message struct {
    Flags     byte
    Signature []byte
    Payload   []byte
}

func NewMessage(payload []byte) *Message {
    return &Message{Flags: 0, Payload: payload}
}

func (self *Message) Bytes() []byte {
    return append([]byte{self.Flags}, append(self.Signature, self.Payload...)...)
}