bufreader

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Apache-2.0 Imports: 19 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 bufio implements buffered I/O. It wraps an FileReader or io.Writer object, creating another object (Reader or Writer) that also implements the interface but provides buffering and some help for textual I/O.

Index

Constants

View Source
const (
	DefaultBufSize           = 4096
	MaxHeadPatternBufferSize = 20 * 1024 * 1024
)

Variables

View Source
var (
	ErrInvalidUnreadByte = errors.New("bufio: invalid use of UnreadByte")
	ErrInvalidUnreadRune = errors.New("bufio: invalid use of UnreadRune")
	ErrBufferFull        = errors.New("bufio: buffer full")
	ErrNegativeCount     = errors.New("bufio: negative count")
)

Functions

func NewFileDirReader

func NewFileDirReader(meta *reader.Meta, conf conf.MapConf) (reader reader.Reader, err error)

func NewSingleFileReader

func NewSingleFileReader(meta *reader.Meta, conf conf.MapConf) (reader reader.Reader, err error)

Types

type BufReader

type BufReader struct {
	Meta *reader.Meta // 存放offset的元信息
	// contains filtered or unexported fields
}

BufReader implements buffering for an FileReader object.

func NewReaderSize

func NewReaderSize(rd reader.FileReader, meta *reader.Meta, size int) (*BufReader, error)

NewReaderSize returns a new Reader whose buffer has at least the specified size. If the argument FileReader is already a Reader with large enough size, it returns the underlying Reader.

func (*BufReader) Close

func (b *BufReader) Close() error

func (*BufReader) FormMutiLine

func (b *BufReader) FormMutiLine() []byte

func (*BufReader) Lag

func (b *BufReader) Lag() (rl *LagInfo, err error)

func (*BufReader) Name

func (b *BufReader) Name() string

func (*BufReader) ReadDone

func (b *BufReader) ReadDone() bool

func (*BufReader) ReadLine

func (b *BufReader) ReadLine() (ret string, err error)

ReadLine returns a string line as a normal Reader

func (*BufReader) ReadPattern

func (b *BufReader) ReadPattern() (string, error)

ReadPattern读取日志直到匹配行首模式串

func (*BufReader) ReadString

func (b *BufReader) ReadString(delim byte) (ret string, err error)

ReadString reads until the first occurrence of delim in the input, returning a string containing the data up to and including the delimiter. If ReadString encounters an error before finding a delimiter, it returns the data read before the error and the error itself (often io.EOF). ReadString returns err != nil if and only if the returned data does not end in delim. For simple uses, a Scanner may be more convenient.

func (*BufReader) SetMode

func (b *BufReader) SetMode(mode string, v interface{}) (err error)

func (*BufReader) SetRunTime

func (b *BufReader) SetRunTime(mode string, v interface{}) (err error)

func (*BufReader) Source

func (b *BufReader) Source() string

func (*BufReader) Status

func (b *BufReader) Status() StatsInfo

func (*BufReader) SyncMeta

func (b *BufReader) SyncMeta()

type LastSync

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

type LineCache

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

func NewLineCache

func NewLineCache() *LineCache

func (*LineCache) Append

func (l *LineCache) Append(r string)

func (*LineCache) Combine

func (l *LineCache) Combine() []byte

func (*LineCache) Set

func (l *LineCache) Set(r []string)

func (*LineCache) Size

func (l *LineCache) Size() int

func (*LineCache) TotalLen

func (l *LineCache) TotalLen() int

Jump to

Keyboard shortcuts

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