filterdsl

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateRule

type AggregateRule struct {
	Type  AggregateType
	Field string
	Label string
}

type AggregateType

type AggregateType string
const (
	AggCount AggregateType = "count"
	AggSum   AggregateType = "sum"
	AggAvg   AggregateType = "avg"
	AggFirst AggregateType = "first"
	AggLast  AggregateType = "last"
)

type ChunkRule

type ChunkRule struct {
	Delimiter string
	MaxChunks int
}

type DSLParser

type DSLParser struct{}

func NewDSLParser

func NewDSLParser() *DSLParser

func (*DSLParser) Parse

func (p *DSLParser) Parse(tomlContent string) (*FilterDefinition, error)

type DSLValidator

type DSLValidator struct{}

func NewDSLValidator

func NewDSLValidator() *DSLValidator

func (*DSLValidator) Validate

func (v *DSLValidator) Validate(fd *FilterDefinition) []string

type FilterDefinition

type FilterDefinition struct {
	Name         string
	Match        string
	SkipRules    []Rule
	KeepRules    []Rule
	ReplaceRules []Rule
	Dedup        bool
	Sections     []SectionRule
	Aggregates   []AggregateRule
	Chunks       []ChunkRule
	JSONPath     string
	Template     string
	Variables    map[string]string
	Conditions   []string
	// contains filtered or unexported fields
}

func (*FilterDefinition) Apply

func (fd *FilterDefinition) Apply(input string) string

func (*FilterDefinition) Matches

func (fd *FilterDefinition) Matches(command string) bool

type Rule

type Rule struct {
	Type        RuleType
	Pattern     string
	Replacement string
	// contains filtered or unexported fields
}

type RuleType

type RuleType string
const (
	RuleSkip      RuleType = "skip"
	RuleKeep      RuleType = "keep"
	RuleReplace   RuleType = "replace"
	RuleDedup     RuleType = "dedup"
	RuleSection   RuleType = "section"
	RuleAggregate RuleType = "aggregate"
	RuleChunk     RuleType = "chunk"
	RuleJSONPath  RuleType = "jsonpath"
	RuleTemplate  RuleType = "template"
)

type SectionRule

type SectionRule struct {
	Name  string
	Start string
	End   string
	Rules []Rule
}

Jump to

Keyboard shortcuts

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