chore: the resolve and findProcess behaviors of Logic and SubRules follow the order and needs of the internal rules

This commit is contained in:
wwqgtxx
2025-06-10 20:11:50 +08:00
parent 01f8f2db2f
commit ae7967f662
29 changed files with 121 additions and 231 deletions

View File

@@ -91,9 +91,7 @@ type RuleProvider interface {
Provider
Behavior() RuleBehavior
Count() int
Match(*constant.Metadata) bool
ShouldResolveIP() bool
ShouldFindProcess() bool
Match(metadata *constant.Metadata, helper constant.RuleMatchHelper) bool
Strategy() any
}

View File

@@ -111,14 +111,17 @@ func (rt RuleType) String() string {
type Rule interface {
RuleType() RuleType
Match(metadata *Metadata) (bool, string)
Match(metadata *Metadata, helper RuleMatchHelper) (bool, string)
Adapter() string
Payload() string
ShouldResolveIP() bool
ShouldFindProcess() bool
ProviderNames() []string
}
type RuleMatchHelper struct {
ResolveIP func()
FindProcess func()
}
type RuleGroup interface {
Rule
GetRecodeSize() int