processor

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Any

type Any struct {
	NoTick
	// contains filtered or unexported fields
}

Any is an Processor that feeds every message to Action.

func NewAny

func NewAny(action types.Action) *Any

NewAny creates a new instance of ProcessorLog.

func (*Any) ProcessMessage

func (p *Any) ProcessMessage(ctx context.Context, message types.Message) error

ProcessMessage implements Processor.

type Factory

type Factory func() (types.Processor, error)

type Matcher

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

func NewMatcher

func NewMatcher(params MatcherParams) *Matcher

func (*Matcher) ProcessMessage

func (p *Matcher) ProcessMessage(ctx context.Context, message types.Message) error

ProcessMessage implements Processor.

func (*Matcher) Tick

func (p *Matcher) Tick(ctx context.Context, now time.Time) error

Tick implements Processor.

type MatcherParams

type MatcherParams struct {
	StartLine  types.Matcher // Start is required.
	EndLine    types.Matcher // End is optional for multiline matching.
	IncludeEnd bool
	MaxLines   int          // MaxLines is max nmber of lines lines to match.
	Action     types.Action // Action to perform upon a match is found.
	GroupBy    []string     // Fields to group by.
}

type NoTick

type NoTick struct{}

func (NoTick) Tick

func (d NoTick) Tick(context.Context, time.Time) error

type Serial

type Serial []types.Processor

Serial implements Processor by procesing the messages in sequence until the end, or until an error is reached.

func (Serial) ProcessMessage

func (p Serial) ProcessMessage(ctx context.Context, message types.Message) error

ProcessMessage implements Processor.

func (Serial) Tick

func (p Serial) Tick(ctx context.Context, now time.Time) error

Tick implements Processor.

Jump to

Keyboard shortcuts

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