bufio

package
v1.1.18 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMismatchTokenPair = errors.New("mismatch token pair")
	ErrInvalidStartToken = errors.New("invalid start token")
)

Functions

This section is empty.

Types

type DelimiterPair

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

type PairScanner

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

A PairScanner reads and decodes Pair wrapped values from an input stream, like a json、xml.

func NewPairScanner

func NewPairScanner(r io.Reader) *PairScanner

NewPairScanner returns a new scanner that reads from r.

The scanner introduces its own buffering and may read data from r beyond the JSON values requested.

func (*PairScanner) Buffered

func (pairScanner *PairScanner) Buffered() io.Reader

Buffered returns a reader of the data remaining in the PairScanner's buffer. The reader is valid until the next call to Decode.

func (*PairScanner) Scan

func (pairScanner *PairScanner) Scan(pairs []DelimiterPair) (line []byte, err error)

Scan reads the next value complete wrapped by pair delimiters from its input and stores it in the value pointed to by v.

func (*PairScanner) ScanDelimiters

func (pairScanner *PairScanner) ScanDelimiters(delimiters string) (line []byte, err error)

func (*PairScanner) SetDiscardLeading

func (pairScanner *PairScanner) SetDiscardLeading(discard bool) *PairScanner

type ReaderPool

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

func NewReaderPool

func NewReaderPool() *ReaderPool

func NewReaderPoolSize

func NewReaderPoolSize(size int) *ReaderPool

func (*ReaderPool) Clear

func (p *ReaderPool) Clear()

func (*ReaderPool) Get

func (p *ReaderPool) Get(r io.Reader) *bufio.Reader

func (*ReaderPool) Put

func (p *ReaderPool) Put(br *bufio.Reader)

type WriterPool

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

func NewWriterPool

func NewWriterPool() *WriterPool

func NewWriterPoolSize

func NewWriterPoolSize(size int) *WriterPool

func (*WriterPool) Clear

func (p *WriterPool) Clear()

func (*WriterPool) Get

func (p *WriterPool) Get(w io.Writer) *bufio.Writer

func (*WriterPool) Put

func (p *WriterPool) Put(br *bufio.Writer)

Jump to

Keyboard shortcuts

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