node

package
v4.1.14 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAndInstrument

func ParseAndInstrument(conditional string, dnsTimeout time.Duration) (Node, *ValFilterNode, error)

ParseAndInstrument parses and instruments the given conditional string for evaluation. This is the main external function related to conditionals.

func QueryConditionalString

func QueryConditionalString(conditionalNode Node, filterNode Node) string

QueryConditionalString constructs the conditional string shown in the "Conditions" output field based on the query conditions and the query filter

Types

type Node

type Node interface {
	fmt.Stringer

	// Evaluates the conditional. Make sure that you called
	// instrument before calling this.
	Evaluate(types.Key) bool

	// Returns the set of attributes used in the conditional.
	Attributes() map[string]types.IPVersion
	// contains filtered or unexported methods
}

Node describes an AST node for the conditional grammar This interface is not meant to be implemented by structs outside of this package.

type ValFilterNode

type ValFilterNode struct {
	FilterType string
	ValFilter  hashmap.ValFilter
	LeftNode   bool
	// contains filtered or unexported fields
}

ValFilterNode describes a node representing a ValFilter. LeftNode is true if the ValFilterNode occurs on the left side of a conjunction (andNode) and false if it occurs on the right side.

func (ValFilterNode) Attributes

func (n ValFilterNode) Attributes() map[string]types.IPVersion

func (ValFilterNode) Evaluate

func (n ValFilterNode) Evaluate(comparisonValue types.Key) bool

func (ValFilterNode) String

func (n ValFilterNode) String() string

Jump to

Keyboard shortcuts

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