aboutsummaryrefslogtreecommitdiff
path: root/writer.go
diff options
context:
space:
mode:
authoronur1 <onur1@onurgunduz.com>2023-01-01 18:44:45 +0100
committeronur1 <onur1@onurgunduz.com>2023-01-01 18:44:45 +0100
commit77e13c055fdc76ff9babbb43754a8f8e44ca6128 (patch)
tree298ba0734bf93cee47aad6150c9ffcd4ca3d87dc /writer.go
parent02387a1dc1ec156e0613920645cf47a51a04a930 (diff)
downloadmuxer-77e13c055fdc76ff9babbb43754a8f8e44ca6128.tar.gz
muxer-77e13c055fdc76ff9babbb43754a8f8e44ca6128.zip
Add documentation
Diffstat (limited to 'writer.go')
-rw-r--r--writer.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/writer.go b/writer.go
index fdfa5ec..df5c134 100644
--- a/writer.go
+++ b/writer.go
@@ -3,19 +3,20 @@ package binproto
import (
"bufio"
"encoding/binary"
- "math"
)
-var maxID = int(math.Pow(2, 60)) - 1
-
+// A Writer implements convenience methods for writing
+// requests or responses to a binary protocol network connection.
type Writer struct {
wd *bufio.Writer
}
+// NewWriter returns a new Writer writing to w.
func NewWriter(wd *bufio.Writer) *Writer {
return &Writer{wd: wd}
}
+// WriteMessage writes a variable number of messages to w.
func (w *Writer) WriteMessage(messages ...*Message) error {
var err error
if len(messages) == 1 {