2022-01-22 14:10:45 +00:00
|
|
|
package common
|
2018-06-10 14:50:03 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
C "github.com/Dreamacro/clash/constant"
|
|
|
|
)
|
|
|
|
|
2019-02-18 13:53:57 +00:00
|
|
|
type Match struct {
|
2022-03-12 17:21:23 +00:00
|
|
|
*Base
|
|
|
|
adapter string
|
2018-06-10 14:50:03 +00:00
|
|
|
}
|
|
|
|
|
2019-02-18 13:53:57 +00:00
|
|
|
func (f *Match) RuleType() C.RuleType {
|
|
|
|
return C.MATCH
|
2018-06-10 14:50:03 +00:00
|
|
|
}
|
|
|
|
|
2019-10-27 16:02:23 +00:00
|
|
|
func (f *Match) Match(metadata *C.Metadata) bool {
|
2018-06-10 14:50:03 +00:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2019-02-18 13:53:57 +00:00
|
|
|
func (f *Match) Adapter() string {
|
2018-06-10 14:50:03 +00:00
|
|
|
return f.adapter
|
|
|
|
}
|
|
|
|
|
2019-02-18 13:53:57 +00:00
|
|
|
func (f *Match) Payload() string {
|
2018-06-20 14:41:02 +00:00
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2022-03-12 17:21:23 +00:00
|
|
|
func NewMatch(adapter string) *Match {
|
2019-02-18 13:53:57 +00:00
|
|
|
return &Match{
|
2022-03-12 17:21:23 +00:00
|
|
|
Base: &Base{},
|
|
|
|
adapter: adapter,
|
2018-06-10 14:50:03 +00:00
|
|
|
}
|
|
|
|
}
|
2022-03-12 17:21:23 +00:00
|
|
|
|
|
|
|
var _ C.Rule = (*Match)(nil)
|