filterprocessor

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package filterprocessor docs

Index

Constants

View Source
const PluginName = "filter_processor"

PluginName to use when configuring.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// <code>search-inner</code> configures the filter processor to recursively search inner transactions for expressions.
	SearchInner bool `yaml:"search-inner"`
	// <code>omit-group-transactions</code> configures the filter processor to return the matched transaction without its grouped transactions.
	OmitGroupTransactions bool `yaml:"omit-group-transactions"`
	/* <code>filters</code> are a list of SubConfig objects with an operation acting as the string key in the map

	filters:
		- [any,all,none]:
			expression: ""
			expression-type: ""
			tag: ""
	*/
	Filters []map[string][]SubConfig `yaml:"filters"`
}

Config configuration for the filter processor

type FilterProcessor

type FilterProcessor struct {
	FieldFilters []fields.Filter
	// contains filtered or unexported fields
}

FilterProcessor filters transactions by a variety of means

func (*FilterProcessor) Close

func (a *FilterProcessor) Close() error

Close a no-op for this processor

func (*FilterProcessor) Config

func (a *FilterProcessor) Config() string

Config returns the config

func (*FilterProcessor) Init

Init initializes the filter processor

func (*FilterProcessor) Metadata

func (a *FilterProcessor) Metadata() plugins.Metadata

Metadata returns metadata

func (*FilterProcessor) Process

func (a *FilterProcessor) Process(input data.BlockData) (data.BlockData, error)

Process processes the input data

type SubConfig

type SubConfig struct {
	/* <code>tag</code> is the tag of the struct to analyze.<br/>
	It can be of the form `txn.*` where the specific ending is determined by the field you wish to filter on.<br/>
	It can also be a field in the ApplyData.
	*/
	FilterTag string `yaml:"tag"`
	/* <code>expression-type</code> is the type of comparison applied between the field, identified by the tag, and the expression.<br/>
	<ul>
		<li>exact</li>
		<li>regex</li>
		<li>less-than</li>
		<li>less-than-equal</li>
		<li>greater-than</li>
		<li>great-than-equal</li>
		<li>equal</li>
		<li>not-equal</li>
	</ul>
	*/
	ExpressionType expression.Type `yaml:"expression-type"`
	// <code>expression</code> is the user-supplied part of the search or comparison.
	Expression string `yaml:"expression"`
}

SubConfig is the configuration needed for each additional filter

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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