Documentation ¶
Index ¶
Constants ¶
View Source
const ( TypeCSV = "csv" TypeLTSV = "ltsv" TypeRegExp = "regexp" )
View Source
const DefaultMaxLineWidth = 4 * 1024 // assume disk block size is 4K
Variables ¶
View Source
var (
ErrNoMatchedFile = errors.New("no matched files")
)
View Source
var ErrTooLongLine = errors.New("too long line")
Functions ¶
func IsParseError ¶
Types ¶
type CSVParser ¶
type CSVParser struct { Config CSVConfig // contains filtered or unexported fields }
type LTSVConfig ¶
type LTSVParser ¶
type LTSVParser struct {
// contains filtered or unexported fields
}
func NewLTSVParser ¶
func NewLTSVParser(config LTSVConfig, in io.Reader) (*LTSVParser, error)
func (LTSVParser) Info ¶
func (p LTSVParser) Info() string
func (*LTSVParser) ReadLine ¶
func (p *LTSVParser) ReadLine(line LogLine) error
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
func (ParseError) Error ¶
func (e ParseError) Error() string
func (ParseError) Unwrap ¶
func (e ParseError) Unwrap() error
type Parser ¶
type ParserConfig ¶
type ParserConfig struct { LogType string `yaml:"log_type"` CSV CSVConfig `yaml:"csv_config"` LTSV LTSVConfig `yaml:"ltsv_config"` RegExp RegExpConfig `yaml:"regexp_config"` }
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
TODO: better reopen algorithm TODO: handle truncate Reader is a log rotate aware Reader
func Open ¶
Open a file and seek to end of the file. path: shell file name pattern excludePath: shell file name pattern
func (*Reader) CurrentFilename ¶
CurrentFilename get current opened file name
type RegExpConfig ¶
type RegExpConfig struct {
Pattern string `yaml:"pattern"`
}
type RegExpParser ¶
type RegExpParser struct {
// contains filtered or unexported fields
}
func NewRegExpParser ¶
func NewRegExpParser(config RegExpConfig, in io.Reader) (*RegExpParser, error)
func (RegExpParser) Info ¶
func (p RegExpParser) Info() string
func (*RegExpParser) ReadLine ¶
func (p *RegExpParser) ReadLine(line LogLine) error
Click to show internal directories.
Click to hide internal directories.