javascript

package
v0.0.0-...-2081a44 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodingError

func DecodingError(err error) error

func ErrorUnknownFormat

func ErrorUnknownFormat(format string) error

func InvalidTopicError

func InvalidTopicError(topic string) error

func TopicNameIsValid

func TopicNameIsValid(name string) bool

Types

type ConcreteParser

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

func (*ConcreteParser) Parse

func (p *ConcreteParser) Parse(rawMessage []byte) ([]*model.SyslogMessage, error)

type Environment

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

func NewFilterEnvironment

func NewFilterEnvironment(filterFunc, topicFunc, topicTmpl, partitionKeyFunc, partitionKeyTmpl, partitionNumberFunc string, logger log15.Logger) *Environment

func NewParsersEnvironment

func NewParsersEnvironment(logger log15.Logger) *Environment

func (*Environment) AddParser

func (e *Environment) AddParser(name string, parserFunc string) error

func (*Environment) FilterMessage

func (e *Environment) FilterMessage(m *model.SyslogMessage) (filterResult FilterResult, err error)

func (*Environment) GetParser

func (e *Environment) GetParser(name string) (func(m []byte) ([]*model.SyslogMessage, error), error)

func (*Environment) PartitionKey

func (e *Environment) PartitionKey(m *model.SyslogMessage) (partitionKey string, err error)

func (*Environment) PartitionNumber

func (e *Environment) PartitionNumber(m *model.SyslogMessage) (partitionNumber int32, err error)

func (*Environment) Topic

func (e *Environment) Topic(m *model.SyslogMessage) (topic string, err error)

type FilterEnvironment

type FilterEnvironment interface {
	FilterMessage(m *model.SyslogMessage) (result *model.SyslogMessage, filterResult FilterResult, err error)
	PartitionKey(m model.SyslogMessage) (partitionKey string, errs []error)
	PartitionNumber(m model.SyslogMessage) (partitionNumber int32, errs []error)
	Topic(m *model.SyslogMessage) (topic string, errs []error)
}

type FilterResult

type FilterResult int64
const (
	PASS         FilterResult = 0
	DROPPED      FilterResult = 1
	REJECTED     FilterResult = 2
	FILTER_ERROR FilterResult = 3
)

type ParsersEnvironment

type ParsersEnvironment interface {
	GetParser(name string) (func(m []byte) ([]*model.SyslogMessage, error), error)
	AddParser(name string, parserFunc string) error
}

Jump to

Keyboard shortcuts

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