From 6e69e3de1b5f885fd6fc9afb029fc198eed291f4 Mon Sep 17 00:00:00 2001 From: Alexandre Vicenzi Date: Thu, 9 Jul 2020 14:15:12 +0200 Subject: [PATCH] Add missing docs --- message.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/message.go b/message.go index 69f7691..41bcafe 100644 --- a/message.go +++ b/message.go @@ -29,6 +29,7 @@ func NewMessage(id, data, event string) *Message { } } +// Buffer formats the message. func (m *Message) Buffer() *bytes.Buffer { var buffer bytes.Buffer @@ -53,10 +54,12 @@ func (m *Message) Buffer() *bytes.Buffer { return &buffer } +// String returns the formated message as a string. func (m *Message) String() string { return m.Buffer().String() } +// Bytes returns the formated message as a byte array. func (m *Message) Bytes() []byte { return m.Buffer().Bytes() }