mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-14 05:11:17 +08:00
36 lines
500 B
Go
36 lines
500 B
Go
package common
|
|
|
|
import (
|
|
C "github.com/metacubex/mihomo/constant"
|
|
)
|
|
|
|
type Match struct {
|
|
*Base
|
|
adapter string
|
|
}
|
|
|
|
func (f *Match) RuleType() C.RuleType {
|
|
return C.MATCH
|
|
}
|
|
|
|
func (f *Match) Match(metadata *C.Metadata) (bool, string) {
|
|
return true, f.adapter
|
|
}
|
|
|
|
func (f *Match) Adapter() string {
|
|
return f.adapter
|
|
}
|
|
|
|
func (f *Match) Payload() string {
|
|
return ""
|
|
}
|
|
|
|
func NewMatch(adapter string) *Match {
|
|
return &Match{
|
|
Base: &Base{},
|
|
adapter: adapter,
|
|
}
|
|
}
|
|
|
|
//var _ C.Rule = (*Match)(nil)
|