diff options
Diffstat (limited to 'whisper/message.go')
-rw-r--r-- | whisper/message.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/whisper/message.go b/whisper/message.go new file mode 100644 index 000000000..21cf163e6 --- /dev/null +++ b/whisper/message.go @@ -0,0 +1,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...)...) +} |