Documentation
¶
Overview ¶
Copyright (c) 2025 Tobias Schäfer. All rights reserved. Licensed under the MIT License, see LICENSE file in the project root for details.
Copyright (c) 2025 Tobias Schäfer. All rights reserved. Licensed under the MIT License, see LICENSE file in the project root for details.
Copyright (c) 2025 Tobias Schäfer. All rights reserved. Licensed under the MIT License, see LICENSE file in the project root for details.
Copyright (c) 2025 Tobias Schäfer. All rights reserved. Licensed under the MIT License, see LICENSE file in the project root for details.
Copyright (c) 2025 Tobias Schäfer. All rights reserved. Licensed under the MIT License, see LICENSE file in the project root for details.
Index ¶
- type Action
- type AddressPredicate
- type AnyPredicate
- type BinaryExpr
- type BinaryOp
- type CompiledRule
- type ExprNode
- type Filter
- type Lexer
- type NetworkPredicate
- type Parser
- type PortPredicate
- type Predicate
- type PredicateFunc
- type ProtocolPredicate
- type Rule
- type Token
- type TokenType
- type TypePredicate
- type UnaryExpr
- type UnaryOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶ added in v1.0.0
type Action int
Action represents the action to take when a rule matches
type AddressPredicate ¶ added in v1.0.0
type AddressPredicate struct {
Direction string // source, destination
Addresses []string // IP addresses or CIDR
Ports []uint16 // optional ports
}
AddressPredicate matches IP addresses or CIDR ranges
type AnyPredicate ¶ added in v1.0.0
type AnyPredicate struct{}
AnyPredicate matches any event (catch-all)
type BinaryExpr ¶ added in v1.0.0
BinaryExpr represents a binary expression (AND, OR)
type CompiledRule ¶ added in v1.0.0
type CompiledRule struct {
Rule *Rule
Predicate PredicateFunc
RuleText string
}
CompiledRule represents a parsed and compiled filter rule
type ExprNode ¶ added in v1.0.0
type ExprNode interface {
// contains filtered or unexported methods
}
ExprNode represents a node in the expression AST
type Filter ¶
type Filter struct {
Rules []CompiledRule
}
Filter represents a compiled set of filter rules
type NetworkPredicate ¶ added in v1.0.0
type NetworkPredicate struct {
Direction string // source, destination
Networks []string // LOCAL, PRIVATE, PUBLIC, MULTICAST
}
NetworkPredicate matches network types
type PortPredicate ¶ added in v1.0.0
type PortPredicate struct {
Direction string // source, destination
Ports []uint16 // port numbers or ranges
}
PortPredicate matches ports
type Predicate ¶ added in v1.0.0
type Predicate interface {
ExprNode
// contains filtered or unexported methods
}
Predicate represents a base predicate
type PredicateFunc ¶ added in v1.0.0
PredicateFunc is a function that evaluates a predicate against an event
func Compile ¶ added in v1.0.0
func Compile(expr ExprNode) (PredicateFunc, error)
Compile compiles an expression AST into a predicate function
type ProtocolPredicate ¶ added in v1.0.0
type ProtocolPredicate struct {
Protocols []string // TCP, UDP
}
ProtocolPredicate matches protocols
type TypePredicate ¶ added in v1.0.0
type TypePredicate struct {
Types []string // NEW, UPDATE, DESTROY
}
TypePredicate matches event types