filtermodel

package
v0.0.0-...-3f413d8 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package filtermodel holds rules related files

Package filtermodel holds rules related files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OSOnlyFilterEvent

type OSOnlyFilterEvent struct {
	// contains filtered or unexported fields
}

OSOnlyFilterEvent defines an os-only rule filter event

func (*OSOnlyFilterEvent) GetFieldEventType

func (e *OSOnlyFilterEvent) GetFieldEventType(_ eval.Field) (string, error)

GetFieldEventType returns the event type for the given field

func (*OSOnlyFilterEvent) GetFieldType

func (e *OSOnlyFilterEvent) GetFieldType(field eval.Field) (reflect.Kind, error)

GetFieldType get the type of the field

func (*OSOnlyFilterEvent) GetFieldValue

func (e *OSOnlyFilterEvent) GetFieldValue(field eval.Field) (interface{}, error)

GetFieldValue gets a field value

func (*OSOnlyFilterEvent) GetTags

func (e *OSOnlyFilterEvent) GetTags() []string

GetTags returns the tags for this event

func (*OSOnlyFilterEvent) GetType

func (e *OSOnlyFilterEvent) GetType() string

GetType returns the type for this event

func (*OSOnlyFilterEvent) Init

func (e *OSOnlyFilterEvent) Init()

Init inits the rule filter event

func (*OSOnlyFilterEvent) SetFieldValue

func (e *OSOnlyFilterEvent) SetFieldValue(field eval.Field, _ interface{}) error

SetFieldValue sets the value for the given field

type OSOnlyFilterModel

type OSOnlyFilterModel struct {
	// contains filtered or unexported fields
}

OSOnlyFilterModel defines a filter model

func NewOSOnlyFilterModel

func NewOSOnlyFilterModel(os string) *OSOnlyFilterModel

NewOSOnlyFilterModel returns a new rule filter model

func (*OSOnlyFilterModel) GetEvaluator

func (m *OSOnlyFilterModel) GetEvaluator(field eval.Field, _ eval.RegisterID) (eval.Evaluator, error)

GetEvaluator gets the evaluator

func (*OSOnlyFilterModel) GetFieldRestrictions

func (m *OSOnlyFilterModel) GetFieldRestrictions(_ eval.Field) []eval.EventType

GetFieldRestrictions returns the field event type restrictions

func (*OSOnlyFilterModel) NewEvent

func (m *OSOnlyFilterModel) NewEvent() eval.Event

NewEvent returns a new event

func (*OSOnlyFilterModel) ValidateField

func (m *OSOnlyFilterModel) ValidateField(_ string, _ eval.FieldValue) error

ValidateField returns whether the value use against the field is valid

type RuleFilterEvent

type RuleFilterEvent struct {
	*kernel.Version
	// contains filtered or unexported fields
}

RuleFilterEvent defines a rule filter event

func (*RuleFilterEvent) GetFieldEventType

func (e *RuleFilterEvent) GetFieldEventType(_ eval.Field) (string, error)

GetFieldEventType returns the event type for the given field

func (*RuleFilterEvent) GetFieldType

func (e *RuleFilterEvent) GetFieldType(field eval.Field) (reflect.Kind, error)

GetFieldType get the type of the field

func (*RuleFilterEvent) GetFieldValue

func (e *RuleFilterEvent) GetFieldValue(field eval.Field) (interface{}, error)

GetFieldValue gets a field value

func (*RuleFilterEvent) GetTags

func (e *RuleFilterEvent) GetTags() []string

GetTags returns the tags for this event

func (*RuleFilterEvent) GetType

func (e *RuleFilterEvent) GetType() string

GetType returns the type for this event

func (*RuleFilterEvent) Init

func (e *RuleFilterEvent) Init()

Init inits the rule filter event

func (*RuleFilterEvent) SetFieldValue

func (e *RuleFilterEvent) SetFieldValue(field eval.Field, _ interface{}) error

SetFieldValue sets the value for the given field

type RuleFilterModel

type RuleFilterModel struct {
	*kernel.Version
	// contains filtered or unexported fields
}

RuleFilterModel defines a filter model

func NewRuleFilterModel

func NewRuleFilterModel(cfg *config.Config, origin string) (*RuleFilterModel, error)

NewRuleFilterModel returns a new rule filter model

func (*RuleFilterModel) GetEvaluator

func (m *RuleFilterModel) GetEvaluator(field eval.Field, _ eval.RegisterID) (eval.Evaluator, error)

GetEvaluator gets the evaluator

func (*RuleFilterModel) GetFieldRestrictions

func (m *RuleFilterModel) GetFieldRestrictions(_ eval.Field) []eval.EventType

GetFieldRestrictions returns the field event type restrictions

func (*RuleFilterModel) NewEvent

func (m *RuleFilterModel) NewEvent() eval.Event

NewEvent returns a new event

func (*RuleFilterModel) ValidateField

func (m *RuleFilterModel) ValidateField(_ string, _ eval.FieldValue) error

ValidateField returns whether the value use against the field is valid

Jump to

Keyboard shortcuts

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