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: 0

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

func ConvertWebParserConfig(conf conf.MapConf) conf.MapConf

func ParseLine

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

func ParseLineDataSlice

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

func RegisterConstructor

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

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

type Flushable

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

type ParseInfo

type ParseInfo struct {
	Line  string
	Index int
}

type ParseResult

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

type ParseResultSlice

type ParseResultSlice []ParseResult

func (ParseResultSlice) Len

func (slice ParseResultSlice) Len() int

func (ParseResultSlice) Less

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

func (ParseResultSlice) Swap

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

type Parser

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

type ParserType

type ParserType interface {
	Type() string
}

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) NewLogParser

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

func (*Registry) RegisterParser

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

type ServerParser

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