github.com/kelleygo/clashcore@v1.0.2/rules/common/final.go (about) 1 package common 2 3 import ( 4 C "github.com/kelleygo/clashcore/constant" 5 ) 6 7 type Match struct { 8 *Base 9 adapter string 10 } 11 12 func (f *Match) RuleType() C.RuleType { 13 return C.MATCH 14 } 15 16 func (f *Match) Match(metadata *C.Metadata) (bool, string) { 17 return true, f.adapter 18 } 19 20 func (f *Match) Adapter() string { 21 return f.adapter 22 } 23 24 func (f *Match) Payload() string { 25 return "" 26 } 27 28 func NewMatch(adapter string) *Match { 29 return &Match{ 30 Base: &Base{}, 31 adapter: adapter, 32 } 33 } 34 35 //var _ C.Rule = (*Match)(nil)