mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-12-19 16:30:07 +08:00
Some checks are pending
Test / test (1.20, macos-13) (push) Waiting to run
Test / test (1.20, macos-latest) (push) Waiting to run
Test / test (1.20, ubuntu-24.04-arm) (push) Waiting to run
Test / test (1.20, ubuntu-latest) (push) Waiting to run
Test / test (1.20, windows-latest) (push) Waiting to run
Test / test (1.21, macos-13) (push) Waiting to run
Test / test (1.21, macos-latest) (push) Waiting to run
Test / test (1.21, ubuntu-24.04-arm) (push) Waiting to run
Test / test (1.21, ubuntu-latest) (push) Waiting to run
Test / test (1.21, windows-latest) (push) Waiting to run
Test / test (1.22, macos-13) (push) Waiting to run
Test / test (1.22, macos-latest) (push) Waiting to run
Test / test (1.22, ubuntu-24.04-arm) (push) Waiting to run
Test / test (1.22, ubuntu-latest) (push) Waiting to run
Test / test (1.22, windows-latest) (push) Waiting to run
Test / test (1.23, macos-13) (push) Waiting to run
Test / test (1.23, macos-latest) (push) Waiting to run
Test / test (1.23, ubuntu-24.04-arm) (push) Waiting to run
Test / test (1.23, ubuntu-latest) (push) Waiting to run
Test / test (1.23, windows-latest) (push) Waiting to run
Test / test (1.24, macos-13) (push) Waiting to run
Test / test (1.24, macos-latest) (push) Waiting to run
Test / test (1.24, ubuntu-24.04-arm) (push) Waiting to run
Test / test (1.24, ubuntu-latest) (push) Waiting to run
Test / test (1.24, windows-latest) (push) Waiting to run
Trigger CMFA Update / trigger-CMFA-update (push) Waiting to run
37 lines
628 B
Go
37 lines
628 B
Go
package common
|
|
|
|
import (
|
|
"errors"
|
|
|
|
C "github.com/metacubex/mihomo/constant"
|
|
|
|
"golang.org/x/exp/slices"
|
|
)
|
|
|
|
var (
|
|
errPayload = errors.New("payloadRule error")
|
|
)
|
|
|
|
// params
|
|
var (
|
|
NoResolve = "no-resolve"
|
|
Src = "src"
|
|
)
|
|
|
|
type Base struct {
|
|
}
|
|
|
|
func (b *Base) ProviderNames() []string { return nil }
|
|
|
|
func ParseParams(params []string) (isSrc bool, noResolve bool) {
|
|
isSrc = slices.Contains(params, Src)
|
|
if isSrc {
|
|
noResolve = true
|
|
} else {
|
|
noResolve = slices.Contains(params, NoResolve)
|
|
}
|
|
return
|
|
}
|
|
|
|
type ParseRuleFunc func(tp, payload, target string, params []string, subRules map[string][]C.Rule) (C.Rule, error)
|