github.com/igoogolx/clash@v1.19.8/rule/final.go (about)

     1  package rules
     2  
     3  import (
     4  	C "github.com/igoogolx/clash/constant"
     5  )
     6  
     7  // Implements C.Rule
     8  var _ C.Rule = (*Match)(nil)
     9  
    10  type Match struct {
    11  	adapter string
    12  }
    13  
    14  func (f *Match) RuleType() C.RuleType {
    15  	return C.MATCH
    16  }
    17  
    18  func (f *Match) Match(metadata *C.Metadata) bool {
    19  	return true
    20  }
    21  
    22  func (f *Match) Adapter() string {
    23  	return f.adapter
    24  }
    25  
    26  func (f *Match) Payload() string {
    27  	return ""
    28  }
    29  
    30  func (f *Match) ShouldResolveIP() bool {
    31  	return false
    32  }
    33  
    34  func (f *Match) ShouldFindProcess() bool {
    35  	return false
    36  }
    37  
    38  func NewMatch(adapter string) *Match {
    39  	return &Match{
    40  		adapter: adapter,
    41  	}
    42  }