diff options
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 { |
