parser

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: 9 Imported by: 44

Documentation

Index

Constants

View Source
const SECOND_PER_5MIN = 5 * 60
View Source
const SECOND_PER_DAY = 24 * 60 * 60

Variables

This section is empty.

Functions

func ConvertWebParserConfig added in v1.4.6

func ConvertWebParserConfig(conf conf.MapConf) conf.MapConf

func ParseLine added in v1.5.3

func ParseLine(dataPipeline <-chan ParseInfo, resultChan chan ParseResult, wg *sync.WaitGroup,
	trimSpace bool, handlerFunc func(string) (Data, error))

func ParseLineDataSlice added in v1.5.3

func ParseLineDataSlice(dataPipeline <-chan ParseInfo, resultChan chan ParseResult, wg *sync.WaitGroup,
	trimSpace bool, handlerFunc func(string) ([]Data, error))

func RegisterConstructor added in v1.5.0

func RegisterConstructor(typ string, c Constructor)

RegisterConstructor adds a new constructor for a given type of reader.

func Time1Day

func Time1Day(t int64) string

func Time1DayInt

func Time1DayInt(t int64) int64

func Time5Min

func Time5Min(t int64) string

func Time5MinInt

func Time5MinInt(t int64) int64

Types

type Constructor added in v1.5.0

type Constructor func(conf.MapConf) (Parser, error)

type Flushable added in v1.4.5

type Flushable interface {
	Flush() (Data, error)
}

type ParseInfo added in v1.5.3

type ParseInfo struct {
	Line  string
	Index int
}

type ParseResult added in v1.5.3

type ParseResult struct {
	Line  string
	Index int
	Data  Data
	Datas []Data
	Err   error
}

type ParseResultSlice added in v1.5.3

type ParseResultSlice []ParseResult

func (ParseResultSlice) Len added in v1.5.3

func (slice ParseResultSlice) Len() int

func (ParseResultSlice) Less added in v1.5.3

func (slice ParseResultSlice) Less(i, j int) bool

func (ParseResultSlice) Swap added in v1.5.3

func (slice ParseResultSlice) Swap(i, j int)

type Parser added in v1.5.0

type Parser interface {
	Name() string
	// parse lines into structured datas
	Parse(lines []string) (datas []Data, err error)
}

type ParserType added in v1.3.6

type ParserType interface {
	Type() string
}

type Registry added in v1.5.0

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

func NewRegistry added in v1.5.0

func NewRegistry() *Registry

func (*Registry) NewLogParser added in v1.5.0

func (ps *Registry) NewLogParser(conf conf.MapConf) (p Parser, err error)

func (*Registry) RegisterParser added in v1.5.0

func (ps *Registry) RegisterParser(parserType string, constructor func(conf.MapConf) (Parser, error)) error

type ServerParser added in v1.5.4

type ServerParser interface {
	ServerConfig() map[string]interface{}
}

Directories

Path Synopsis
Package builtin does nothing but import all builtin parsers to execute their init functions.
Package builtin does nothing but import all builtin parsers to execute their init functions.

Jump to

Keyboard shortcuts

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