linewriter

package
v0.0.0-...-168ccc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package linewriter implements a write filter that expect "\n" or "\r" ended lines as its input.

Index

Constants

This section is empty.

Variables

View Source
var (
	CRLF = []byte{'\r', '\n'}
	CR   = CRLF[0:1]
	LF   = CRLF[1:2]
)

Functions

This section is empty.

Types

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer allows to write input text line by line to provided output io.Writer. If no conversion is enabled it calls output.Write method once per line. In conversion mode it converts any newline to provided nl string but in this case it can use more than one write for one line. If bufio.Writer is used as output it calls its Flush method after each line written.

func Make

func Make(output io.Writer, newnl []byte) Writer

func New

func New(output io.Writer, newnl []byte) *Writer

func (*Writer) Flush

func (w *Writer) Flush() error

func (*Writer) Write

func (w *Writer) Write(buf []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL