diff options
| author | onur1 <onur1@onurgunduz.com> | 2023-01-01 18:44:45 +0100 |
|---|---|---|
| committer | onur1 <onur1@onurgunduz.com> | 2023-01-01 18:44:45 +0100 |
| commit | 77e13c055fdc76ff9babbb43754a8f8e44ca6128 (patch) | |
| tree | 298ba0734bf93cee47aad6150c9ffcd4ca3d87dc /writer.go | |
| parent | 02387a1dc1ec156e0613920645cf47a51a04a930 (diff) | |
| download | muxer-77e13c055fdc76ff9babbb43754a8f8e44ca6128.tar.gz muxer-77e13c055fdc76ff9babbb43754a8f8e44ca6128.zip | |
Add documentation
Diffstat (limited to 'writer.go')
| -rw-r--r-- | writer.go | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 { |
