provider

package
v1.16.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPayload = errors.New("file must have a `payload` field")

Functions

func NewClassicalStrategy

func NewClassicalStrategy(parse func(tp, payload, target string, params []string, subRules map[string][]C.Rule) (parsed C.Rule, parseErr error)) *classicalStrategy

func NewDomainStrategy

func NewDomainStrategy() *domainStrategy

func NewIPCidrStrategy

func NewIPCidrStrategy() *ipcidrStrategy

func NewRuleSetProvider

func NewRuleSetProvider(name string, behavior P.RuleBehavior, format P.RuleFormat, interval time.Duration, vehicle P.Vehicle,
	parse func(tp, payload, target string, params []string, subRules map[string][]C.Rule) (parsed C.Rule, parseErr error)) P.RuleProvider

func ParseRuleProvider

func ParseRuleProvider(name string, mapping map[string]interface{}, parse func(tp, payload, target string, params []string, subRules map[string][]C.Rule) (parsed C.Rule, parseErr error)) (P.RuleProvider, error)

func RuleProviders

func RuleProviders() map[string]P.RuleProvider

func SetRuleProvider

func SetRuleProvider(ruleProvider P.RuleProvider)

Types

type RulePayload

type RulePayload struct {
	/**
	key: Domain or IP Cidr
	value: Rule type or is empty
	*/
	Payload []string `yaml:"payload"`
	Rules   []string `yaml:"rules"`
}

type RuleSet

type RuleSet struct {
	*common.Base
	// contains filtered or unexported fields
}

func NewRuleSet

func NewRuleSet(ruleProviderName string, adapter string, noResolveIP bool) (*RuleSet, error)

func (*RuleSet) Adapter

func (rs *RuleSet) Adapter() string

func (*RuleSet) Match

func (rs *RuleSet) Match(metadata *C.Metadata) (bool, string)

func (*RuleSet) Payload

func (rs *RuleSet) Payload() string

func (*RuleSet) RuleType

func (rs *RuleSet) RuleType() C.RuleType

func (*RuleSet) ShouldFindProcess

func (rs *RuleSet) ShouldFindProcess() bool

func (*RuleSet) ShouldResolveIP

func (rs *RuleSet) ShouldResolveIP() bool

type RuleSetProvider

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

func (RuleSetProvider) AsRule

func (rp RuleSetProvider) AsRule(adaptor string) C.Rule

func (RuleSetProvider) Behavior

func (rp RuleSetProvider) Behavior() P.RuleBehavior

func (RuleSetProvider) Initial

func (rp RuleSetProvider) Initial() error

func (RuleSetProvider) MarshalJSON

func (rp RuleSetProvider) MarshalJSON() ([]byte, error)

func (RuleSetProvider) Match

func (rp RuleSetProvider) Match(metadata *C.Metadata) bool

func (RuleSetProvider) ShouldFindProcess

func (rp RuleSetProvider) ShouldFindProcess() bool

func (RuleSetProvider) ShouldResolveIP

func (rp RuleSetProvider) ShouldResolveIP() bool

func (RuleSetProvider) Type

func (rp RuleSetProvider) Type() P.ProviderType

func (RuleSetProvider) Update

func (rp RuleSetProvider) Update() error

Jump to

Keyboard shortcuts

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