2018-06-10 22:50:03 +08:00
|
|
|
package rules
|
|
|
|
|
|
|
|
import (
|
|
|
|
C "github.com/Dreamacro/clash/constant"
|
|
|
|
)
|
|
|
|
|
2019-02-18 21:53:57 +08:00
|
|
|
type Match struct {
|
2018-06-10 22:50:03 +08:00
|
|
|
adapter string
|
|
|
|
}
|
|
|
|
|
2019-02-18 21:53:57 +08:00
|
|
|
func (f *Match) RuleType() C.RuleType {
|
|
|
|
return C.MATCH
|
2018-06-10 22:50:03 +08:00
|
|
|
}
|
|
|
|
|
2019-10-28 00:02:23 +08:00
|
|
|
func (f *Match) Match(metadata *C.Metadata) bool {
|
2018-06-10 22:50:03 +08:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2019-02-18 21:53:57 +08:00
|
|
|
func (f *Match) Adapter() string {
|
2018-06-10 22:50:03 +08:00
|
|
|
return f.adapter
|
|
|
|
}
|
|
|
|
|
2019-02-18 21:53:57 +08:00
|
|
|
func (f *Match) Payload() string {
|
2018-06-20 22:41:02 +08:00
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2020-07-27 11:57:55 +08:00
|
|
|
func (f *Match) ShouldResolveIP() bool {
|
|
|
|
return false
|
2019-10-28 00:02:23 +08:00
|
|
|
}
|
|
|
|
|
2021-08-31 21:46:04 +08:00
|
|
|
func (f *Match) RuleExtra() *C.RuleExtra {
|
|
|
|
return nil
|
2021-07-01 22:49:29 +08:00
|
|
|
}
|
|
|
|
|
2019-02-18 21:53:57 +08:00
|
|
|
func NewMatch(adapter string) *Match {
|
|
|
|
return &Match{
|
2018-06-10 22:50:03 +08:00
|
|
|
adapter: adapter,
|
|
|
|
}
|
|
|
|
}
|