mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-26 16:57:08 +00:00
chore: add sourceGeoIP and sourceIPASN to metadata
This commit is contained in:
11
constant/matcher.go
Normal file
11
constant/matcher.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package constant
|
||||
|
||||
import "net/netip"
|
||||
|
||||
type DomainMatcher interface {
|
||||
MatchDomain(domain string) bool
|
||||
}
|
||||
|
||||
type IpMatcher interface {
|
||||
MatchIp(ip netip.Addr) bool
|
||||
}
|
||||
@@ -133,7 +133,9 @@ type Metadata struct {
|
||||
Type Type `json:"type"`
|
||||
SrcIP netip.Addr `json:"sourceIP"`
|
||||
DstIP netip.Addr `json:"destinationIP"`
|
||||
SrcGeoIP []string `json:"sourceGeoIP"` // can be nil if never queried, empty slice if got no result
|
||||
DstGeoIP []string `json:"destinationGeoIP"` // can be nil if never queried, empty slice if got no result
|
||||
SrcIPASN string `json:"sourceIPASN"`
|
||||
DstIPASN string `json:"destinationIPASN"`
|
||||
SrcPort uint16 `json:"sourcePort,string"` // `,string` is used to compatible with old version json output
|
||||
DstPort uint16 `json:"destinationPort,string"` // `,string` is used to compatible with old version json output
|
||||
|
||||
@@ -27,8 +27,6 @@ const (
|
||||
ProcessNameRegex
|
||||
ProcessPathRegex
|
||||
RuleSet
|
||||
DomainSet
|
||||
IpCidrSet
|
||||
Network
|
||||
Uid
|
||||
SubRules
|
||||
@@ -92,10 +90,6 @@ func (rt RuleType) String() string {
|
||||
return "Match"
|
||||
case RuleSet:
|
||||
return "RuleSet"
|
||||
case DomainSet:
|
||||
return "DomainSet"
|
||||
case IpCidrSet:
|
||||
return "IpCidrSet"
|
||||
case Network:
|
||||
return "Network"
|
||||
case DSCP:
|
||||
|
||||
Reference in New Issue
Block a user