Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BadExtractor = extractors.BadExtractor
BadExtractor is an error occurring when extractor is invalid.
var BadLabelName = extractors.BadLabelName
BadLabelName is an error occurring when label name is invalid.
var BadRego = badRego{}
BadRego is an error occurring when rego compilation fails.
var BadSelector = badSelector{}
BadSelector is an error occurring when selector is invalid.
Functions ¶
This section is empty.
Types ¶
type CompiledRuleset ¶
type CompiledRuleset struct { ControlPointID selectors.ControlPointID Labelers []LabelerWithSelector ReportedRules []ReportedRule }
CompiledRuleset is compiled form of Classifier proto.
func CompileRuleset ¶
func CompileRuleset(ctx context.Context, name string, classifier *classificationv1.Classifier) (CompiledRuleset, error)
CompileRuleset parses ruleset's selector and compiles its rules.
type LabelFlags ¶
type LabelFlags struct { // Should the created label be applied to the whole flow (propagated in baggage) Propagate bool // Should the created flow label be hidden from telemetry Hidden bool }
LabelFlags are flags for a flow label.
type Labeler ¶
type Labeler struct { // rego query that's prepared to take envoy authz request as an input. // Result expression should be a single value (if LabelName is set) or a // map[string]interface{} otherwise. Query rego.PreparedEvalQuery // flags for created flow labels: LabelsFlags map[string]LabelFlags // multi-label variant // flow label that the result should be assigned to (single-label variant) LabelName string LabelFlags LabelFlags // single-label variant }
Labeler is used to create flow labels
label can create either: * a single label – LabelName is non-empty or * multiple labels – LabelName is empty.
type LabelerWithSelector ¶
type LabelerWithSelector struct { Labeler *Labeler LabelSelector multimatcher.Expr }
LabelerWithSelector is a labeler with its selector.
type ReportedRule ¶
type ReportedRule struct { Selector *selectorv1.Selector Rule *classificationv1.Rule RulesetName string LabelName string }
ReportedRule is a rule along with its selector and label name.