filter

package
v0.1.3-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindBexpr   = "bexpr"
	KindQuamina = "quamina"
)

Variables

View Source
var (
	ErrInvalidFilter = errors.New("invalid filter")
)

Functions

This section is empty.

Types

type BexprFilter

type BexprFilter struct {
	Expression string `hcl:"expression"`
	// contains filtered or unexported fields
}

func (*BexprFilter) Process

func (b *BexprFilter) Process(ctx context.Context, event *optimusv1.LogEvent) (*optimusv1.LogEvent, error)

func (*BexprFilter) Setup

func (b *BexprFilter) Setup() error

type Filter

type Filter struct {
	ID         string
	Broker     pubsub.Broker
	Subscriber pubsub.Subscriber

	Kind          string
	Subscriptions []string
	BufferSize    int
	// contains filtered or unexported fields
}

func New

func New(id, kind string, bufferSize int, subscriptions []string, impl FilterProcessor) (*Filter, error)

func (*Filter) Init

func (f *Filter) Init() error

func (*Filter) Process

func (f *Filter) Process(ctx context.Context) error

type FilterProcessor

type FilterProcessor interface {
	Process(context.Context, *optimusv1.LogEvent) (*optimusv1.LogEvent, error)
	Setup() error
}

func HclImpl

func HclImpl(kind string, ctx *hcl.EvalContext, body hcl.Body) (FilterProcessor, hcl.Diagnostics)

type QuaminaFilter

type QuaminaFilter struct {
	Patterns map[string]string `hcl:"patterns"`
	// contains filtered or unexported fields
}

func (*QuaminaFilter) Process

func (q *QuaminaFilter) Process(ctx context.Context, event *optimusv1.LogEvent) (*optimusv1.LogEvent, error)

func (*QuaminaFilter) Setup

func (q *QuaminaFilter) Setup() error

Jump to

Keyboard shortcuts

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