godock: github.com/sqp/godock/libs/text/linesplit Index | Files

package linesplit

import "github.com/sqp/godock/libs/text/linesplit"

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


Package Files


type Writer Uses

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 Uses

func NewWriter(callback func(string)) *Writer

NewWriter creates a Writer forwarding every line received to callback.

func (*Writer) Close Uses

func (g *Writer) Close()

Close flushes the remaining buffer content.

func (*Writer) Write Uses

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

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

Package linesplit imports 1 packages (graph) and is imported by 4 packages. Updated 2016-07-21. Refresh now. Tools for package owners.