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
- Variables
- func NewFileDirReader(meta *reader.Meta, conf conf.MapConf) (reader reader.Reader, err error)
- func NewSingleFileReader(meta *reader.Meta, conf conf.MapConf) (reader reader.Reader, err error)
- type BufReader
- func (b *BufReader) Close() error
- func (b *BufReader) FormMutiLine() []byte
- func (b *BufReader) Lag() (rl *LagInfo, err error)
- func (b *BufReader) Name() string
- func (b *BufReader) ReadDone() bool
- func (b *BufReader) ReadLine() (ret string, err error)
- func (b *BufReader) ReadPattern() (string, error)
- func (b *BufReader) ReadString(delim byte) (ret string, err error)
- func (b *BufReader) SetMode(mode string, v interface{}) (err error)
- func (b *BufReader) SetRunTime(mode string, v interface{}) (err error)
- func (b *BufReader) Source() string
- func (b *BufReader) Status() StatsInfo
- func (b *BufReader) SyncMeta()
- type LastSync
- type LineCache
Constants ¶
const ( DefaultBufSize = 4096 MaxHeadPatternBufferSize = 20 * 1024 * 1024 )
Variables ¶
Functions ¶
func NewFileDirReader ¶
Types ¶
type BufReader ¶
type BufReader struct { Meta *reader.Meta // 存放offset的元信息 // contains filtered or unexported fields }
BufReader implements buffering for an FileReader object.
func NewReaderSize ¶
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) FormMutiLine ¶
func (*BufReader) ReadPattern ¶
ReadPattern读取日志直到匹配行首模式串
func (*BufReader) ReadString ¶
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) SetRunTime ¶
type LineCache ¶
type LineCache struct {
// contains filtered or unexported fields
}
func NewLineCache ¶
func NewLineCache() *LineCache