final.go 500 B

1234567891011121314151617181920212223242526272829303132333435
  1. package common
  2. import (
  3. C "github.com/metacubex/mihomo/constant"
  4. )
  5. type Match struct {
  6. *Base
  7. adapter string
  8. }
  9. func (f *Match) RuleType() C.RuleType {
  10. return C.MATCH
  11. }
  12. func (f *Match) Match(metadata *C.Metadata) (bool, string) {
  13. return true, f.adapter
  14. }
  15. func (f *Match) Adapter() string {
  16. return f.adapter
  17. }
  18. func (f *Match) Payload() string {
  19. return ""
  20. }
  21. func NewMatch(adapter string) *Match {
  22. return &Match{
  23. Base: &Base{},
  24. adapter: adapter,
  25. }
  26. }
  27. //var _ C.Rule = (*Match)(nil)