mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-26 16:57:08 +00:00
feat: support rule disabling and hit/miss count/at tracking in restful api (#2502)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package constant
|
||||
|
||||
import "time"
|
||||
|
||||
// Rule Type
|
||||
const (
|
||||
Domain RuleType = iota
|
||||
@@ -126,6 +128,27 @@ type Rule interface {
|
||||
ProviderNames() []string
|
||||
}
|
||||
|
||||
type RuleWrapper interface {
|
||||
Rule
|
||||
|
||||
// SetDisabled to set enable/disable rule
|
||||
SetDisabled(v bool)
|
||||
// IsDisabled return rule is disabled or not
|
||||
IsDisabled() bool
|
||||
|
||||
// HitCount for statistics
|
||||
HitCount() uint64
|
||||
// HitAt for statistics
|
||||
HitAt() time.Time
|
||||
// MissCount for statistics
|
||||
MissCount() uint64
|
||||
// MissAt for statistics
|
||||
MissAt() time.Time
|
||||
|
||||
// Unwrap return Rule
|
||||
Unwrap() Rule
|
||||
}
|
||||
|
||||
type RuleMatchHelper struct {
|
||||
ResolveIP func()
|
||||
FindProcess func()
|
||||
|
||||
Reference in New Issue
Block a user