chore: cleanup patch code

This commit is contained in:
wwqgtxx
2024-08-27 11:04:42 +08:00
parent 6e04e1e9dc
commit 3e2c9ce821
9 changed files with 83 additions and 74 deletions

View File

@@ -1,6 +1,7 @@
package provider
import (
"context"
"fmt"
"github.com/metacubex/mihomo/common/utils"
@@ -31,7 +32,7 @@ func (v VehicleType) String() string {
}
type Vehicle interface {
Read() ([]byte, error)
Read(ctx context.Context) ([]byte, error)
Path() string
Proxy() string
Type() VehicleType
@@ -83,6 +84,7 @@ type ProxyProvider interface {
type RuleProvider interface {
Provider
Behavior() RuleBehavior
Count() int
Match(*constant.Metadata) bool
ShouldResolveIP() bool
ShouldFindProcess() bool