Skip to content

Commit

Permalink
Add missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrevicenzi committed Jul 9, 2020
1 parent 024714d commit 6e69e3d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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()
}

0 comments on commit 6e69e3d

Please sign in to comment.