import "github.com/byte-mug/fastnntp-backend2/iohelper"
IO Helper routines and structures.
type Chopper struct { Rest io.Writer // contains filtered or unexported fields }
Chopper chops off the first leading "\r\n" or "\n"
func (c *Chopper) Write(p []byte) (n int, err error)
-
type Splitter struct { Head io.Writer Body io.Writer // contains filtered or unexported fields }
Splitter is a writer, that splits a RFC-822 style message into Header and Body. The algorithm is oppinionated, as it assumes that every '\r' is followed by an '\n'.
Note that the body starts with a newline ("\n" or "\r\n")!
func (s *Splitter) Write(p []byte) (n int, err error)
-
import "errors"
import "io"