github.com/yaling888/clash@v1.53.0/rule/final.go (about)

     1  package rules
     2  
     3  import (
     4  	C "github.com/yaling888/clash/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 {
    17  	return true
    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 (f *Match) ShouldResolveIP() bool {
    29  	return false
    30  }
    31  
    32  func NewMatch(adapter string) *Match {
    33  	return &Match{
    34  		Base:    &Base{},
    35  		adapter: adapter,
    36  	}
    37  }
    38  
    39  var _ C.Rule = (*Match)(nil)