topology

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPromCounter added in v1.8.0

func GetPromCounter(config map[interface{}]interface{}) prometheus.Counter

Types

type Filter

type Filter interface {
	Filter(map[string]interface{}) (map[string]interface{}, bool)
}

type FilterBox

type FilterBox struct {
	Filter Filter
	// contains filtered or unexported fields
}

func BuildFilterBoxes

func BuildFilterBoxes(config map[string]interface{}, buildFilter buildFilterFunc) []*FilterBox

func NewFilterBox

func NewFilterBox(config map[interface{}]interface{}) *FilterBox

func (*FilterBox) PostProcess

func (f *FilterBox) PostProcess(event map[string]interface{}, success bool) map[string]interface{}

func (*FilterBox) Process

func (b *FilterBox) Process(event map[string]interface{}) map[string]interface{}

type Input

type Input interface {
	ReadOneEvent() map[string]interface{}
	Shutdown()
}
type NilProcessorInLink struct{}

func (*NilProcessorInLink) Process

func (n *NilProcessorInLink) Process(event map[string]interface{}) map[string]interface{}

type Output

type Output interface {
	Emit(map[string]interface{})
	Shutdown()
}

type OutputBox

type OutputBox struct {
	Output
	*condition_filter.ConditionFilter
	// contains filtered or unexported fields
}

func BuildOutputs

func BuildOutputs(config map[string]interface{}, buildOutput buildOutputFunc) []*OutputBox

func (*OutputBox) Process

func (p *OutputBox) Process(event map[string]interface{}) map[string]interface{}

Process implement Processor interface

type OutputsProcessor

type OutputsProcessor []*OutputBox

func (OutputsProcessor) Process

func (p OutputsProcessor) Process(event map[string]interface{}) map[string]interface{}

Process implement Processor interface

type Processor

type Processor interface {
	Process(map[string]interface{}) map[string]interface{}
}

FilterBox and OutputBox is Processor

type ProcessorNode

type ProcessorNode struct {
	Processor Processor
	Next      *ProcessorNode
}

ProcessorNode is a node in the filter/output link

func AppendProcessorsToLink(head *ProcessorNode, processors ...Processor) *ProcessorNode

AppendProcessorsToLink add new processors to tail, return head node

func (*ProcessorNode) Process

func (node *ProcessorNode) Process(event map[string]interface{}) map[string]interface{}

Processor will process event , and pass it to next, and then next , until last one(generally output)

Jump to

Keyboard shortcuts

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