linesplit

package
v0.0.0-...-0caaa62 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 1 Imported by: 0

Documentation

Overview

Package linesplit provides a Writer with a callback on every line.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

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

Writer defines a line splitter Writer.

The buffer will be flushed on Close.

Separator: \n

func NewWriter

func NewWriter(callback func(string)) *Writer

NewWriter creates a Writer forwarding every line received to callback.

func (*Writer) Close

func (g *Writer) Close()

Close flushes the remaining buffer content.

func (*Writer) Write

func (g *Writer) Write(p []byte) (n int, err error)

Write forwards every line received to the callback (separator \n).

Jump to

Keyboard shortcuts

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