Documentation ¶
Index ¶
- Variables
- type ActiveRuleset
- type ClassificationEngine
- func (c *ClassificationEngine) ActiveRules() []compiler.ReportedRule
- func (c *ClassificationEngine) AddRules(ctx context.Context, name string, ...) (ActiveRuleset, error)
- func (c *ClassificationEngine) Classify(ctx context.Context, svcs []string, ctrlPt selectors.ControlPoint, ...) ([]*flowcontrolv1.ClassifierInfo, flowlabel.FlowLabels, error)
- func (c *ClassificationEngine) GetSelector() *selectorv1.Selector
- type ClassificationEngineIn
Constants ¶
This section is empty.
Variables ¶
var Module fx.Option = fx.Options( fx.Provide( fx.Annotated{ Target: setupEtcdClassifierWatcher, Name: "classifier", }, ProvideClassificationEngine, ), )
Module is a default set of components to enable flow classification
Note: this module provides just a Classifier datastructure, with no API endpoint. Example API endpoint to the classifier is pkg/envoy.
Functions ¶
This section is empty.
Types ¶
type ActiveRuleset ¶
type ActiveRuleset struct {
// contains filtered or unexported fields
}
ActiveRuleset represents one of currently active set of rules.
func (ActiveRuleset) Drop ¶
func (rs ActiveRuleset) Drop()
Drop retracts all the rules belonging to a ruleset.
type ClassificationEngine ¶ added in v0.2.1
type ClassificationEngine struct {
// contains filtered or unexported fields
}
ClassificationEngine receives classification policies and provides Classify method.
func NewClassificationEngine ¶ added in v0.3.0
func NewClassificationEngine(registry status.Registry) *ClassificationEngine
NewClassificationEngine creates a new Flow Classifier.
func ProvideClassificationEngine ¶ added in v0.2.1
func ProvideClassificationEngine(in ClassificationEngineIn) *ClassificationEngine
ProvideClassificationEngine provides a classifier that loads the rules from config file.
func (*ClassificationEngine) ActiveRules ¶ added in v0.2.1
func (c *ClassificationEngine) ActiveRules() []compiler.ReportedRule
ActiveRules returns a slice of uncompiled Rules which are currently active.
func (*ClassificationEngine) AddRules ¶ added in v0.2.1
func (c *ClassificationEngine) AddRules( ctx context.Context, name string, classifierWrapper *wrappersv1.ClassifierWrapper, ) (ActiveRuleset, error)
AddRules compiles a ruleset and adds it to the active rules
The name will be used for reporting ¶
To retract the rules, call Classifier.Drop.
func (*ClassificationEngine) Classify ¶ added in v0.2.1
func (c *ClassificationEngine) Classify( ctx context.Context, svcs []string, ctrlPt selectors.ControlPoint, labelsForMatching map[string]string, input ast.Value, ) ([]*flowcontrolv1.ClassifierInfo, flowlabel.FlowLabels, error)
Classify takes rego input, performs classification, and returns a map of flow labels. LabelsForMatching are additional labels to use for selector matching.
func (*ClassificationEngine) GetSelector ¶ added in v0.2.1
func (c *ClassificationEngine) GetSelector() *selectorv1.Selector
GetSelector returns the selector.