Package iohelper

import "github.com/byte-mug/fastnntp-backend2/iohelper"

Overview

IO Helper routines and structures.

Index

type Chopper

type Chopper struct {
	Rest io.Writer
	// contains filtered or unexported fields
}

Chopper chops off the first leading "\r\n" or "\n"

func (*Chopper) Write

func (c *Chopper) Write(p []byte) (n int, err error)

-

type Splitter

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 (*Splitter) Write

func (s *Splitter) Write(p []byte) (n int, err error)

-

Dependencies