rule.go 310 B

123456789101112131415161718
  1. package testing
  2. import (
  3. v2net "github.com/v2ray/v2ray-core/common/net"
  4. )
  5. type TestRule struct {
  6. Function func(v2net.Destination) bool
  7. TagValue string
  8. }
  9. func (this *TestRule) Apply(dest v2net.Destination) bool {
  10. return this.Function(dest)
  11. }
  12. func (this *TestRule) Tag() string {
  13. return this.TagValue
  14. }