mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
Chore: rename final
This commit is contained in:
parent
5f26c49641
commit
ef2b5d306d
|
@ -358,7 +358,7 @@ func parseRules(cfg *rawConfig) ([]C.Rule, error) {
|
|||
case "MATCH":
|
||||
fallthrough
|
||||
case "FINAL":
|
||||
rules = append(rules, R.NewFinal(target))
|
||||
rules = append(rules, R.NewMatch(target))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ const (
|
|||
GEOIP
|
||||
IPCIDR
|
||||
SourceIPCIDR
|
||||
FINAL
|
||||
MATCH
|
||||
)
|
||||
|
||||
type RuleType int
|
||||
|
@ -27,8 +27,8 @@ func (rt RuleType) String() string {
|
|||
return "IPCIDR"
|
||||
case SourceIPCIDR:
|
||||
return "SourceIPCIDR"
|
||||
case FINAL:
|
||||
return "FINAL"
|
||||
case MATCH:
|
||||
return "MATCH"
|
||||
default:
|
||||
return "Unknow"
|
||||
}
|
||||
|
|
|
@ -4,28 +4,28 @@ import (
|
|||
C "github.com/Dreamacro/clash/constant"
|
||||
)
|
||||
|
||||
type Final struct {
|
||||
type Match struct {
|
||||
adapter string
|
||||
}
|
||||
|
||||
func (f *Final) RuleType() C.RuleType {
|
||||
return C.FINAL
|
||||
func (f *Match) RuleType() C.RuleType {
|
||||
return C.MATCH
|
||||
}
|
||||
|
||||
func (f *Final) IsMatch(metadata *C.Metadata) bool {
|
||||
func (f *Match) IsMatch(metadata *C.Metadata) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (f *Final) Adapter() string {
|
||||
func (f *Match) Adapter() string {
|
||||
return f.adapter
|
||||
}
|
||||
|
||||
func (f *Final) Payload() string {
|
||||
func (f *Match) Payload() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func NewFinal(adapter string) *Final {
|
||||
return &Final{
|
||||
func NewMatch(adapter string) *Match {
|
||||
return &Match{
|
||||
adapter: adapter,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user