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