Documentation
¶
Index ¶
Constants ¶
const InspectorInvalidFactoryConfig = errors.Error("InspectorInvalidFactoryConfig")
InspectorInvalidFactoryConfig is used when an unsupported Inspector is referenced in InspectorFactory
const OperatorInvalidFactoryConfig = errors.Error("OperatorInvalidFactoryConfig")
OperatorInvalidFactoryConfig is used when an unsupported Operator is referenced in OperatorFactory
const OperatorMissingInspectors = errors.Error("OperatorMissingInspectors")
OperatorMissingInspectors is used when an Operator that requres Inspectors is created with no inspectors
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AND ¶
type AND struct {
Inspectors []Inspector
}
AND implements the Operator interface and applies the boolean AND logic to configured inspectors.
type IP ¶
type IP struct {
Key string `mapstructure:"key"`
Function string `mapstructure:"function"`
Negate bool `mapstructure:"negate"`
}
IP implements the Inspector interface for evaluating IP address data. More information is available in the README.
type Inspector ¶
Inspector is the interface shared by all inspector methods.
func InspectorFactory ¶
func InspectorFactory(cfg InspectorConfig) (Inspector, error)
InspectorFactory loads Inspectors from an InspectorConfig. This is the recommended function for retrieving ready-to-use Inspectors.
func MakeInspectors ¶
func MakeInspectors(cfg []InspectorConfig) ([]Inspector, error)
MakeInspectors is a convenience function for making several Inspectors.
type InspectorConfig ¶
InspectorConfig contains arbitrary JSON settings for Inspectors loaded via mapstructure.
type JSONSchema ¶
type JSONSchema struct {
Schema []struct {
Key string `mapstructure:"key"`
Type string `mapstructure:"type"`
} `mapstructure:"schema"`
Negate bool `mapstructure:"negate"`
}
JSONSchema implements the Inspector interface for evaluating JSON schemas. More information is available in the README.
type JSONValid ¶
type JSONValid struct {
Negate bool `mapstructure:"negate"`
}
JSONValid implements the Inspector interface for evaluating the validity of JSON data. More information is available in the README.
type NAND ¶
type NAND struct {
Inspectors []Inspector
}
NAND implements the Operator interface and applies the boolean NAND logic to configured inspectors.
type NOR ¶
type NOR struct {
Inspectors []Inspector
}
NOR implements the Operator interface and applies the boolean NOR logic to configured inspectors.
type OR ¶
type OR struct {
Inspectors []Inspector
}
OR implements the Operator interface and applies the boolean OR logic to configured inspectors.
type Operator ¶
Operator is the interface shared by all operator methods. Most operators contain a list of Inspectors that the operand applies to.
func OperatorFactory ¶
func OperatorFactory(cfg OperatorConfig) (Operator, error)
OperatorFactory loads Operators from an OperatorConfig. This is the recommended function for retrieving ready-to-use Operators.
type OperatorConfig ¶
type OperatorConfig struct {
Operator string
Inspectors []InspectorConfig
}
OperatorConfig contains an array of InspectorConfig that are used to evaluate data.
type RegExp ¶
type RegExp struct {
Key string `mapstructure:"key"`
Expression string `mapstructure:"expression"`
Negate bool `mapstructure:"negate"`
}
RegExp implements the Inspector interface for evaluating data with a regular expression. More information is available in the README.
type Strings ¶
type Strings struct {
Key string `mapstructure:"key"`
Expression string `mapstructure:"expression"`
Function string `mapstructure:"function"`
Negate bool `mapstructure:"negate"`
}
Strings implements the Inspector interface for evaluating data using string functions. More information is available in the README.