Documentation ¶
Index ¶
- Variables
- func GetRuleBase() map[string]RuleBaseCreator
- func GetRuleWrappers() map[string]RuleWrapperCreator
- func PrepareMany(rules []Rule, e wrapper.Entity, logger zerolog.Logger) error
- type CompositeAndRule
- type CompositeAndRuleParams
- type CompositeNotRule
- type CompositeNotRuleParams
- type CompositeOrRule
- type CompositeOrRuleParams
- type GeoParam
- type GeoParams
- type GeoRegexp
- type GeoRule
- type IPRule
- type IPRuleParams
- type InvalidRuleNameError
- type MallebaleRule
- type MallebaleRuleParams
- type RegexpParams
- type RegexpRule
- type ReverseLookupParams
- type ReverseLookupRule
- type Rule
- func NewCompositeAndRule(_ *database.DB, rs RuleSet, cfg common.RuleConfig, _ common.Globals) (Rule, error)
- func NewCompositeNotRule(_ *database.DB, rs RuleSet, cfg common.RuleConfig, _ common.Globals) (Rule, error)
- func NewCompositeOrRule(_ *database.DB, rs RuleSet, cfg common.RuleConfig, _ common.Globals) (Rule, error)
- func NewGeolocationRule(db *database.DB, _ RuleSet, cfg common.RuleConfig, gloals common.Globals) (Rule, error)
- func NewIPRule(_ *database.DB, _ RuleSet, cfg common.RuleConfig, _ common.Globals) (Rule, error)
- func NewMalleableRule(_ *database.DB, _ RuleSet, cfg common.RuleConfig, _ common.Globals) (Rule, error)
- func NewNotWrapper(r Rule, _ common.RuleConfig) Rule
- func NewRegexpRule(_ *database.DB, _ RuleSet, cfg common.RuleConfig, _ common.Globals) (Rule, error)
- func NewReverseLookupRule(db *database.DB, _ RuleSet, cfg common.RuleConfig, _ common.Globals) (Rule, error)
- func NewTimeRule(_ *database.DB, _ RuleSet, cfg common.RuleConfig, _ common.Globals) (Rule, error)
- type RuleBaseCreator
- type RuleSet
- type RuleWrapperCreator
- type TimeParams
- type TimeRule
- type UnknownBaseRuleError
- type UnknownDayOfWeekError
- type UnknownTransformError
- type UnknownWrapperRuleError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetRuleBase ¶
func GetRuleBase() map[string]RuleBaseCreator
func GetRuleWrappers ¶
func GetRuleWrappers() map[string]RuleWrapperCreator
Types ¶
type CompositeAndRule ¶
type CompositeAndRule struct {
// contains filtered or unexported fields
}
func (CompositeAndRule) String ¶
func (f CompositeAndRule) String() string
type CompositeAndRuleParams ¶
type CompositeAndRuleParams struct {
Rules []string `mapstructure:"rules"`
}
type CompositeNotRule ¶
type CompositeNotRule struct {
// contains filtered or unexported fields
}
func (CompositeNotRule) String ¶
func (f CompositeNotRule) String() string
type CompositeNotRuleParams ¶
type CompositeNotRuleParams struct {
Rule string `mapstructure:"rule"`
}
type CompositeOrRule ¶
type CompositeOrRule struct {
// contains filtered or unexported fields
}
func (CompositeOrRule) String ¶
func (f CompositeOrRule) String() string
type CompositeOrRuleParams ¶
type CompositeOrRuleParams struct {
Rules []string `mapstructure:"rules"`
}
type GeoParam ¶
type GeoParam struct { Organisation []string `mapstructure:"organisation"` CountryCode []string `mapstructure:"country_code"` Country []string `mapstructure:"country"` RegionCode []string `mapstructure:"region_code"` Region []string `mapstructure:"region"` City []string `mapstructure:"city"` Timezone []string `mapstructure:"timezone"` ASN []string `mapstructure:"asn"` }
NOTE: GeoParam and GeoRegexp must have same field names.
type GeoRegexp ¶
type GeoRule ¶
type GeoRule struct {
// contains filtered or unexported fields
}
type IPRule ¶
type IPRule struct {
// contains filtered or unexported fields
}
type IPRuleParams ¶
type IPRuleParams struct {
Path string `mapstructure:"list"`
}
type InvalidRuleNameError ¶
type InvalidRuleNameError struct {
// contains filtered or unexported fields
}
func (InvalidRuleNameError) Error ¶
func (e InvalidRuleNameError) Error() string
type MallebaleRule ¶
type MallebaleRule struct {
// contains filtered or unexported fields
}
func (*MallebaleRule) String ¶
func (f *MallebaleRule) String() string
type MallebaleRuleParams ¶
type RegexpParams ¶
type RegexpParams struct {
Path string `mapstructure:"list"`
}
type RegexpRule ¶
type RegexpRule struct {
// contains filtered or unexported fields
}
func (RegexpRule) String ¶
func (f RegexpRule) String() string
type ReverseLookupParams ¶
type ReverseLookupRule ¶
type ReverseLookupRule struct {
// contains filtered or unexported fields
}
func (*ReverseLookupRule) String ¶
func (f *ReverseLookupRule) String() string
type Rule ¶
type Rule interface { Prepare(wrapper.Entity, zerolog.Logger) error Apply(wrapper.Entity, zerolog.Logger) (bool, error) fmt.Stringer }
func NewCompositeAndRule ¶
func NewCompositeNotRule ¶
func NewCompositeOrRule ¶
func NewGeolocationRule ¶
func NewMalleableRule ¶
func NewMalleableRule( _ *database.DB, _ RuleSet, cfg common.RuleConfig, _ common.Globals, ) (Rule, error)
TODO: add unit tests for malleable rule.
func NewNotWrapper ¶
func NewNotWrapper(r Rule, _ common.RuleConfig) Rule
func NewRegexpRule ¶
func NewReverseLookupRule ¶
type RuleBaseCreator ¶
type RuleSet ¶
func NewRuleSet ¶
type RuleWrapperCreator ¶
type RuleWrapperCreator func( rule Rule, cfg common.RuleConfig, ) Rule
type TimeParams ¶
type TimeRule ¶
type TimeRule struct {
// contains filtered or unexported fields
}
type UnknownBaseRuleError ¶
type UnknownBaseRuleError struct {
// contains filtered or unexported fields
}
func (UnknownBaseRuleError) Error ¶
func (e UnknownBaseRuleError) Error() string
type UnknownDayOfWeekError ¶
type UnknownDayOfWeekError struct {
// contains filtered or unexported fields
}
func (UnknownDayOfWeekError) Error ¶
func (e UnknownDayOfWeekError) Error() string
type UnknownTransformError ¶
type UnknownTransformError struct {
// contains filtered or unexported fields
}
func (UnknownTransformError) Error ¶
func (e UnknownTransformError) Error() string
type UnknownWrapperRuleError ¶
type UnknownWrapperRuleError struct {
// contains filtered or unexported fields
}
func (UnknownWrapperRuleError) Error ¶
func (e UnknownWrapperRuleError) Error() string
Click to show internal directories.
Click to hide internal directories.