scanner

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2019 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package scanner provides an interface{} for scanning through a stream of bytes. The interface is compatible with bufio.Scanner.

Examples:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scanner

type Scanner interface {
	Buffer(buf []byte, max int) // sets the initial buffer
	Scan() bool                 // advanced the scanner to the next block
	Bytes() []byte              // returns the bytes of the current block
	Text() string               // returns the text of the current block
}

Scanner is an interface compatible with bufio.Scanner that is used by iterators. By using this interface, we can support streams separated by null bytes, new-line characters, or any separator.

func New

func New(reader io.Reader, separator byte, dropCR bool) Scanner

New returns a new Scanner that reads from the given reader, splits on the given newLine byte, and drops carriage returns if indicated.

Jump to

Keyboard shortcuts

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