Chore: move "geodata" to package "component"

This commit is contained in:
gVisor bot 2021-10-29 00:52:44 +08:00
parent 0f57484f8b
commit 4dcb8294ca
21 changed files with 166 additions and 155 deletions

View file

@ -3,7 +3,7 @@ package geodata
import ( import (
"strings" "strings"
"github.com/Dreamacro/clash/rule/geodata/router" "github.com/Dreamacro/clash/component/geodata/router"
) )
type AttributeList struct { type AttributeList struct {

View file

@ -5,8 +5,8 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/Dreamacro/clash/component/geodata/router"
"github.com/Dreamacro/clash/log" "github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/rule/geodata/router"
) )
type loader struct { type loader struct {

View file

@ -1,6 +1,8 @@
package geodata package geodata
import "github.com/Dreamacro/clash/rule/geodata/router" import (
"github.com/Dreamacro/clash/component/geodata/router"
)
type LoaderImplementation interface { type LoaderImplementation interface {
LoadSite(filename, list string) ([]*router.Domain, error) LoadSite(filename, list string) ([]*router.Domain, error)

View file

@ -5,9 +5,9 @@ import (
"os" "os"
"strings" "strings"
"github.com/Dreamacro/clash/component/geodata/router"
C "github.com/Dreamacro/clash/constant" C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/log" "github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/rule/geodata/router"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )

View file

@ -74,12 +74,12 @@ Loop:
if strings.EqualFold(string(container), code) { if strings.EqualFold(string(container), code) {
count++ count++
offset := -(1 + int64(varintLenByteLen) + int64(codeVarintLength)) offset := -(1 + int64(varintLenByteLen) + int64(codeVarintLength))
f.Seek(offset, 1) // back to the start of GeoIP or GeoSite varint _, _ = f.Seek(offset, 1) // back to the start of GeoIP or GeoSite varint
advancedN = geoDataVarintLength // the number of bytes to be read in next round advancedN = geoDataVarintLength // the number of bytes to be read in next round
} else { } else {
count = 1 count = 1
offset := int64(geoDataVarintLength) - int64(codeVarintLength) - int64(varintLenByteLen) - 1 offset := int64(geoDataVarintLength) - int64(codeVarintLength) - int64(varintLenByteLen) - 1
f.Seek(offset, 1) // skip the unmatched GeoIP or GeoSite varint _, _ = f.Seek(offset, 1) // skip the unmatched GeoIP or GeoSite varint
advancedN = 1 // the next round will be the start of another GeoIPList or GeoSiteList advancedN = 1 // the next round will be the start of another GeoIPList or GeoSiteList
} }
case 6: // matched GeoIP or GeoSite varint case 6: // matched GeoIP or GeoSite varint
@ -95,7 +95,9 @@ func Decode(filename, code string) ([]byte, error) {
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to open file: %s, base error: %s", filename, err.Error()) return nil, fmt.Errorf("failed to open file: %s, base error: %s", filename, err.Error())
} }
defer f.Close() defer func(f *os.File) {
_ = f.Close()
}(f)
geoBytes, err := emitBytes(f, code) geoBytes, err := emitBytes(f, code)
if err != nil { if err != nil {

View file

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"runtime" "runtime"
"github.com/Dreamacro/clash/rule/geodata" "github.com/Dreamacro/clash/component/geodata"
"github.com/Dreamacro/clash/rule/geodata/router" "github.com/Dreamacro/clash/component/geodata/router"
) )
type memConservativeLoader struct { type memConservativeLoader struct {

View file

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/Dreamacro/clash/rule/geodata/strmatcher" "github.com/Dreamacro/clash/component/geodata/strmatcher"
) )
var matcherTypeMap = map[Domain_Type]strmatcher.Type{ var matcherTypeMap = map[Domain_Type]strmatcher.Type{
@ -50,6 +50,7 @@ func NewMphMatcherGroup(domains []*Domain) (*DomainMatcher, error) {
}, nil }, nil
} }
// NewDomainMatcher new domain matcher.
func NewDomainMatcher(domains []*Domain) (*DomainMatcher, error) { func NewDomainMatcher(domains []*Domain) (*DomainMatcher, error) {
g := new(strmatcher.MatcherGroup) g := new(strmatcher.MatcherGroup)
for _, d := range domains { for _, d := range domains {

View file

@ -2,7 +2,7 @@
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.17.3 // protoc v3.17.3
// source: rule/geodata/router/config.proto // source: component/geodata/router/config.proto
package router package router
@ -61,11 +61,11 @@ func (x Domain_Type) String() string {
} }
func (Domain_Type) Descriptor() protoreflect.EnumDescriptor { func (Domain_Type) Descriptor() protoreflect.EnumDescriptor {
return file_rule_geodata_router_config_proto_enumTypes[0].Descriptor() return file_component_geodata_router_config_proto_enumTypes[0].Descriptor()
} }
func (Domain_Type) Type() protoreflect.EnumType { func (Domain_Type) Type() protoreflect.EnumType {
return &file_rule_geodata_router_config_proto_enumTypes[0] return &file_component_geodata_router_config_proto_enumTypes[0]
} }
func (x Domain_Type) Number() protoreflect.EnumNumber { func (x Domain_Type) Number() protoreflect.EnumNumber {
@ -74,7 +74,7 @@ func (x Domain_Type) Number() protoreflect.EnumNumber {
// Deprecated: Use Domain_Type.Descriptor instead. // Deprecated: Use Domain_Type.Descriptor instead.
func (Domain_Type) EnumDescriptor() ([]byte, []int) { func (Domain_Type) EnumDescriptor() ([]byte, []int) {
return file_rule_geodata_router_config_proto_rawDescGZIP(), []int{0, 0} return file_component_geodata_router_config_proto_rawDescGZIP(), []int{0, 0}
} }
// Domain for routing decision. // Domain for routing decision.
@ -84,7 +84,7 @@ type Domain struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
// Domain matching type. // Domain matching type.
Type Domain_Type `protobuf:"varint,1,opt,name=type,proto3,enum=clash.rule.geodata.router.Domain_Type" json:"type,omitempty"` Type Domain_Type `protobuf:"varint,1,opt,name=type,proto3,enum=clash.component.geodata.router.Domain_Type" json:"type,omitempty"`
// Domain value. // Domain value.
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
// Attributes of this domain. May be used for filtering. // Attributes of this domain. May be used for filtering.
@ -94,7 +94,7 @@ type Domain struct {
func (x *Domain) Reset() { func (x *Domain) Reset() {
*x = Domain{} *x = Domain{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rule_geodata_router_config_proto_msgTypes[0] mi := &file_component_geodata_router_config_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -107,7 +107,7 @@ func (x *Domain) String() string {
func (*Domain) ProtoMessage() {} func (*Domain) ProtoMessage() {}
func (x *Domain) ProtoReflect() protoreflect.Message { func (x *Domain) ProtoReflect() protoreflect.Message {
mi := &file_rule_geodata_router_config_proto_msgTypes[0] mi := &file_component_geodata_router_config_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -120,7 +120,7 @@ func (x *Domain) ProtoReflect() protoreflect.Message {
// Deprecated: Use Domain.ProtoReflect.Descriptor instead. // Deprecated: Use Domain.ProtoReflect.Descriptor instead.
func (*Domain) Descriptor() ([]byte, []int) { func (*Domain) Descriptor() ([]byte, []int) {
return file_rule_geodata_router_config_proto_rawDescGZIP(), []int{0} return file_component_geodata_router_config_proto_rawDescGZIP(), []int{0}
} }
func (x *Domain) GetType() Domain_Type { func (x *Domain) GetType() Domain_Type {
@ -159,7 +159,7 @@ type CIDR struct {
func (x *CIDR) Reset() { func (x *CIDR) Reset() {
*x = CIDR{} *x = CIDR{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rule_geodata_router_config_proto_msgTypes[1] mi := &file_component_geodata_router_config_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -172,7 +172,7 @@ func (x *CIDR) String() string {
func (*CIDR) ProtoMessage() {} func (*CIDR) ProtoMessage() {}
func (x *CIDR) ProtoReflect() protoreflect.Message { func (x *CIDR) ProtoReflect() protoreflect.Message {
mi := &file_rule_geodata_router_config_proto_msgTypes[1] mi := &file_component_geodata_router_config_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -185,7 +185,7 @@ func (x *CIDR) ProtoReflect() protoreflect.Message {
// Deprecated: Use CIDR.ProtoReflect.Descriptor instead. // Deprecated: Use CIDR.ProtoReflect.Descriptor instead.
func (*CIDR) Descriptor() ([]byte, []int) { func (*CIDR) Descriptor() ([]byte, []int) {
return file_rule_geodata_router_config_proto_rawDescGZIP(), []int{1} return file_component_geodata_router_config_proto_rawDescGZIP(), []int{1}
} }
func (x *CIDR) GetIp() []byte { func (x *CIDR) GetIp() []byte {
@ -215,7 +215,7 @@ type GeoIP struct {
func (x *GeoIP) Reset() { func (x *GeoIP) Reset() {
*x = GeoIP{} *x = GeoIP{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rule_geodata_router_config_proto_msgTypes[2] mi := &file_component_geodata_router_config_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -228,7 +228,7 @@ func (x *GeoIP) String() string {
func (*GeoIP) ProtoMessage() {} func (*GeoIP) ProtoMessage() {}
func (x *GeoIP) ProtoReflect() protoreflect.Message { func (x *GeoIP) ProtoReflect() protoreflect.Message {
mi := &file_rule_geodata_router_config_proto_msgTypes[2] mi := &file_component_geodata_router_config_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -241,7 +241,7 @@ func (x *GeoIP) ProtoReflect() protoreflect.Message {
// Deprecated: Use GeoIP.ProtoReflect.Descriptor instead. // Deprecated: Use GeoIP.ProtoReflect.Descriptor instead.
func (*GeoIP) Descriptor() ([]byte, []int) { func (*GeoIP) Descriptor() ([]byte, []int) {
return file_rule_geodata_router_config_proto_rawDescGZIP(), []int{2} return file_component_geodata_router_config_proto_rawDescGZIP(), []int{2}
} }
func (x *GeoIP) GetCountryCode() string { func (x *GeoIP) GetCountryCode() string {
@ -276,7 +276,7 @@ type GeoIPList struct {
func (x *GeoIPList) Reset() { func (x *GeoIPList) Reset() {
*x = GeoIPList{} *x = GeoIPList{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rule_geodata_router_config_proto_msgTypes[3] mi := &file_component_geodata_router_config_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -289,7 +289,7 @@ func (x *GeoIPList) String() string {
func (*GeoIPList) ProtoMessage() {} func (*GeoIPList) ProtoMessage() {}
func (x *GeoIPList) ProtoReflect() protoreflect.Message { func (x *GeoIPList) ProtoReflect() protoreflect.Message {
mi := &file_rule_geodata_router_config_proto_msgTypes[3] mi := &file_component_geodata_router_config_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -302,7 +302,7 @@ func (x *GeoIPList) ProtoReflect() protoreflect.Message {
// Deprecated: Use GeoIPList.ProtoReflect.Descriptor instead. // Deprecated: Use GeoIPList.ProtoReflect.Descriptor instead.
func (*GeoIPList) Descriptor() ([]byte, []int) { func (*GeoIPList) Descriptor() ([]byte, []int) {
return file_rule_geodata_router_config_proto_rawDescGZIP(), []int{3} return file_component_geodata_router_config_proto_rawDescGZIP(), []int{3}
} }
func (x *GeoIPList) GetEntry() []*GeoIP { func (x *GeoIPList) GetEntry() []*GeoIP {
@ -324,7 +324,7 @@ type GeoSite struct {
func (x *GeoSite) Reset() { func (x *GeoSite) Reset() {
*x = GeoSite{} *x = GeoSite{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rule_geodata_router_config_proto_msgTypes[4] mi := &file_component_geodata_router_config_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -337,7 +337,7 @@ func (x *GeoSite) String() string {
func (*GeoSite) ProtoMessage() {} func (*GeoSite) ProtoMessage() {}
func (x *GeoSite) ProtoReflect() protoreflect.Message { func (x *GeoSite) ProtoReflect() protoreflect.Message {
mi := &file_rule_geodata_router_config_proto_msgTypes[4] mi := &file_component_geodata_router_config_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -350,7 +350,7 @@ func (x *GeoSite) ProtoReflect() protoreflect.Message {
// Deprecated: Use GeoSite.ProtoReflect.Descriptor instead. // Deprecated: Use GeoSite.ProtoReflect.Descriptor instead.
func (*GeoSite) Descriptor() ([]byte, []int) { func (*GeoSite) Descriptor() ([]byte, []int) {
return file_rule_geodata_router_config_proto_rawDescGZIP(), []int{4} return file_component_geodata_router_config_proto_rawDescGZIP(), []int{4}
} }
func (x *GeoSite) GetCountryCode() string { func (x *GeoSite) GetCountryCode() string {
@ -378,7 +378,7 @@ type GeoSiteList struct {
func (x *GeoSiteList) Reset() { func (x *GeoSiteList) Reset() {
*x = GeoSiteList{} *x = GeoSiteList{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rule_geodata_router_config_proto_msgTypes[5] mi := &file_component_geodata_router_config_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -391,7 +391,7 @@ func (x *GeoSiteList) String() string {
func (*GeoSiteList) ProtoMessage() {} func (*GeoSiteList) ProtoMessage() {}
func (x *GeoSiteList) ProtoReflect() protoreflect.Message { func (x *GeoSiteList) ProtoReflect() protoreflect.Message {
mi := &file_rule_geodata_router_config_proto_msgTypes[5] mi := &file_component_geodata_router_config_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -404,7 +404,7 @@ func (x *GeoSiteList) ProtoReflect() protoreflect.Message {
// Deprecated: Use GeoSiteList.ProtoReflect.Descriptor instead. // Deprecated: Use GeoSiteList.ProtoReflect.Descriptor instead.
func (*GeoSiteList) Descriptor() ([]byte, []int) { func (*GeoSiteList) Descriptor() ([]byte, []int) {
return file_rule_geodata_router_config_proto_rawDescGZIP(), []int{5} return file_component_geodata_router_config_proto_rawDescGZIP(), []int{5}
} }
func (x *GeoSiteList) GetEntry() []*GeoSite { func (x *GeoSiteList) GetEntry() []*GeoSite {
@ -429,7 +429,7 @@ type Domain_Attribute struct {
func (x *Domain_Attribute) Reset() { func (x *Domain_Attribute) Reset() {
*x = Domain_Attribute{} *x = Domain_Attribute{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rule_geodata_router_config_proto_msgTypes[6] mi := &file_component_geodata_router_config_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -442,7 +442,7 @@ func (x *Domain_Attribute) String() string {
func (*Domain_Attribute) ProtoMessage() {} func (*Domain_Attribute) ProtoMessage() {}
func (x *Domain_Attribute) ProtoReflect() protoreflect.Message { func (x *Domain_Attribute) ProtoReflect() protoreflect.Message {
mi := &file_rule_geodata_router_config_proto_msgTypes[6] mi := &file_component_geodata_router_config_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -455,7 +455,7 @@ func (x *Domain_Attribute) ProtoReflect() protoreflect.Message {
// Deprecated: Use Domain_Attribute.ProtoReflect.Descriptor instead. // Deprecated: Use Domain_Attribute.ProtoReflect.Descriptor instead.
func (*Domain_Attribute) Descriptor() ([]byte, []int) { func (*Domain_Attribute) Descriptor() ([]byte, []int) {
return file_rule_geodata_router_config_proto_rawDescGZIP(), []int{0, 0} return file_component_geodata_router_config_proto_rawDescGZIP(), []int{0, 0}
} }
func (x *Domain_Attribute) GetKey() string { func (x *Domain_Attribute) GetKey() string {
@ -502,101 +502,105 @@ func (*Domain_Attribute_BoolValue) isDomain_Attribute_TypedValue() {}
func (*Domain_Attribute_IntValue) isDomain_Attribute_TypedValue() {} func (*Domain_Attribute_IntValue) isDomain_Attribute_TypedValue() {}
var File_rule_geodata_router_config_proto protoreflect.FileDescriptor var File_component_geodata_router_config_proto protoreflect.FileDescriptor
var file_rule_geodata_router_config_proto_rawDesc = []byte{ var file_component_geodata_router_config_proto_rawDesc = []byte{
0x0a, 0x20, 0x72, 0x75, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x72, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2f, 0x67, 0x65, 0x6f, 0x64,
0x6f, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x61, 0x74, 0x61, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69,
0x74, 0x6f, 0x12, 0x19, 0x63, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x72, 0x75, 0x6c, 0x65, 0x2e, 0x67, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x63,
0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x22, 0xc7, 0x02, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61,
0x0a, 0x06, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x3a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x22, 0xd1, 0x02, 0x0a, 0x06, 0x44, 0x6f, 0x6d, 0x61,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x72, 0x69, 0x6e, 0x12, 0x3f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
0x75, 0x6c, 0x65, 0x2e, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x32, 0x2b, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65,
0x65, 0x72, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x6e, 0x74, 0x2e, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65,
0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x72, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x49, 0x0a, 0x09, 0x61, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x4e, 0x0a, 0x09, 0x61, 0x74, 0x74,
0x63, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x72, 0x75, 0x6c, 0x65, 0x2e, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63,
0x74, 0x61, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2e, 0x67,
0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72,
0x69, 0x62, 0x75, 0x74, 0x65, 0x1a, 0x6c, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c,
0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x22, 0x32, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x50,
0x6c, 0x61, 0x69, 0x6e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x65, 0x67, 0x65, 0x78, 0x10,
0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x10, 0x02, 0x12, 0x08, 0x0a,
0x04, 0x46, 0x75, 0x6c, 0x6c, 0x10, 0x03, 0x22, 0x2e, 0x0a, 0x04, 0x43, 0x49, 0x44, 0x52, 0x12,
0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x70, 0x12,
0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x22, 0x84, 0x01, 0x0a, 0x05, 0x47, 0x65, 0x6f, 0x49,
0x50, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79,
0x43, 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x63, 0x69, 0x64, 0x72, 0x18, 0x02, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x72, 0x75, 0x6c, 0x65, 0x2e,
0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x43,
0x49, 0x44, 0x52, 0x52, 0x04, 0x63, 0x69, 0x64, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x76,
0x65, 0x72, 0x73, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08,
0x52, 0x0c, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x22, 0x43,
0x0a, 0x09, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x05, 0x65,
0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6c, 0x61,
0x73, 0x68, 0x2e, 0x72, 0x75, 0x6c, 0x65, 0x2e, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e,
0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x52, 0x05, 0x65, 0x6e,
0x74, 0x72, 0x79, 0x22, 0x67, 0x0a, 0x07, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x12, 0x21,
0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x64,
0x65, 0x12, 0x39, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x72, 0x75, 0x6c, 0x65, 0x2e, 0x67,
0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x44, 0x6f, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x44, 0x6f,
0x6d, 0x61, 0x69, 0x6e, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x47, 0x0a, 0x0b, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x09,
0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x05, 0x65, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x1a, 0x6c, 0x0a, 0x09, 0x41, 0x74, 0x74,
0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x61, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x73, 0x68, 0x2e, 0x72, 0x75, 0x6c, 0x65, 0x2e, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c,
0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x52, 0x05, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09,
0x65, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x6d, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6c, 0x61, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x09, 0x69, 0x6e, 0x74,
0x73, 0x68, 0x2e, 0x72, 0x75, 0x6c, 0x65, 0x2e, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x08,
0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x74, 0x79, 0x70, 0x65,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x2f, 0x63, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x32, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12,
0x6c, 0x61, 0x73, 0x68, 0x2f, 0x72, 0x75, 0x6c, 0x65, 0x2f, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x09, 0x0a, 0x05, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x65,
0x61, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0xaa, 0x02, 0x19, 0x43, 0x6c, 0x61, 0x73, 0x68, 0x67, 0x65, 0x78, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x10,
0x2e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x47, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x75, 0x6c, 0x6c, 0x10, 0x03, 0x22, 0x2e, 0x0a, 0x04, 0x43,
0x75, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x49, 0x44, 0x52, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x02, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x22, 0x89, 0x01, 0x0a, 0x05,
0x47, 0x65, 0x6f, 0x49, 0x50, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79,
0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x63, 0x69, 0x64, 0x72,
0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x63,
0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61,
0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x49, 0x44, 0x52, 0x52, 0x04, 0x63, 0x69,
0x64, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x5f, 0x6d, 0x61,
0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x72, 0x65, 0x76, 0x65, 0x72,
0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x22, 0x48, 0x0a, 0x09, 0x47, 0x65, 0x6f, 0x49, 0x50,
0x4c, 0x69, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6d, 0x70,
0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x72, 0x6f,
0x75, 0x74, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72,
0x79, 0x22, 0x6c, 0x0a, 0x07, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12,
0x3e, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x26, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e,
0x74, 0x2e, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72,
0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22,
0x4c, 0x0a, 0x0b, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3d,
0x0a, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e,
0x63, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2e,
0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x47,
0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x7c, 0x0a,
0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f,
0x6e, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x65, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x72, 0x6f, 0x75,
0x74, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x2f, 0x63, 0x6c, 0x61, 0x73,
0x68, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2f, 0x67, 0x65, 0x6f, 0x64,
0x61, 0x74, 0x61, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0xaa, 0x02, 0x1e, 0x43, 0x6c, 0x61,
0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x6f,
0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
} }
var ( var (
file_rule_geodata_router_config_proto_rawDescOnce sync.Once file_component_geodata_router_config_proto_rawDescOnce sync.Once
file_rule_geodata_router_config_proto_rawDescData = file_rule_geodata_router_config_proto_rawDesc file_component_geodata_router_config_proto_rawDescData = file_component_geodata_router_config_proto_rawDesc
) )
func file_rule_geodata_router_config_proto_rawDescGZIP() []byte { func file_component_geodata_router_config_proto_rawDescGZIP() []byte {
file_rule_geodata_router_config_proto_rawDescOnce.Do(func() { file_component_geodata_router_config_proto_rawDescOnce.Do(func() {
file_rule_geodata_router_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_rule_geodata_router_config_proto_rawDescData) file_component_geodata_router_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_component_geodata_router_config_proto_rawDescData)
}) })
return file_rule_geodata_router_config_proto_rawDescData return file_component_geodata_router_config_proto_rawDescData
} }
var file_rule_geodata_router_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_component_geodata_router_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_rule_geodata_router_config_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_component_geodata_router_config_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_rule_geodata_router_config_proto_goTypes = []interface{}{ var file_component_geodata_router_config_proto_goTypes = []interface{}{
(Domain_Type)(0), // 0: clash.rule.geodata.router.Domain.Type (Domain_Type)(0), // 0: clash.component.geodata.router.Domain.Type
(*Domain)(nil), // 1: clash.rule.geodata.router.Domain (*Domain)(nil), // 1: clash.component.geodata.router.Domain
(*CIDR)(nil), // 2: clash.rule.geodata.router.CIDR (*CIDR)(nil), // 2: clash.component.geodata.router.CIDR
(*GeoIP)(nil), // 3: clash.rule.geodata.router.GeoIP (*GeoIP)(nil), // 3: clash.component.geodata.router.GeoIP
(*GeoIPList)(nil), // 4: clash.rule.geodata.router.GeoIPList (*GeoIPList)(nil), // 4: clash.component.geodata.router.GeoIPList
(*GeoSite)(nil), // 5: clash.rule.geodata.router.GeoSite (*GeoSite)(nil), // 5: clash.component.geodata.router.GeoSite
(*GeoSiteList)(nil), // 6: clash.rule.geodata.router.GeoSiteList (*GeoSiteList)(nil), // 6: clash.component.geodata.router.GeoSiteList
(*Domain_Attribute)(nil), // 7: clash.rule.geodata.router.Domain.Attribute (*Domain_Attribute)(nil), // 7: clash.component.geodata.router.Domain.Attribute
} }
var file_rule_geodata_router_config_proto_depIdxs = []int32{ var file_component_geodata_router_config_proto_depIdxs = []int32{
0, // 0: clash.rule.geodata.router.Domain.type:type_name -> clash.rule.geodata.router.Domain.Type 0, // 0: clash.component.geodata.router.Domain.type:type_name -> clash.component.geodata.router.Domain.Type
7, // 1: clash.rule.geodata.router.Domain.attribute:type_name -> clash.rule.geodata.router.Domain.Attribute 7, // 1: clash.component.geodata.router.Domain.attribute:type_name -> clash.component.geodata.router.Domain.Attribute
2, // 2: clash.rule.geodata.router.GeoIP.cidr:type_name -> clash.rule.geodata.router.CIDR 2, // 2: clash.component.geodata.router.GeoIP.cidr:type_name -> clash.component.geodata.router.CIDR
3, // 3: clash.rule.geodata.router.GeoIPList.entry:type_name -> clash.rule.geodata.router.GeoIP 3, // 3: clash.component.geodata.router.GeoIPList.entry:type_name -> clash.component.geodata.router.GeoIP
1, // 4: clash.rule.geodata.router.GeoSite.domain:type_name -> clash.rule.geodata.router.Domain 1, // 4: clash.component.geodata.router.GeoSite.domain:type_name -> clash.component.geodata.router.Domain
5, // 5: clash.rule.geodata.router.GeoSiteList.entry:type_name -> clash.rule.geodata.router.GeoSite 5, // 5: clash.component.geodata.router.GeoSiteList.entry:type_name -> clash.component.geodata.router.GeoSite
6, // [6:6] is the sub-list for method output_type 6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type 6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name 6, // [6:6] is the sub-list for extension type_name
@ -604,13 +608,13 @@ var file_rule_geodata_router_config_proto_depIdxs = []int32{
0, // [0:6] is the sub-list for field type_name 0, // [0:6] is the sub-list for field type_name
} }
func init() { file_rule_geodata_router_config_proto_init() } func init() { file_component_geodata_router_config_proto_init() }
func file_rule_geodata_router_config_proto_init() { func file_component_geodata_router_config_proto_init() {
if File_rule_geodata_router_config_proto != nil { if File_component_geodata_router_config_proto != nil {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_rule_geodata_router_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_component_geodata_router_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Domain); i { switch v := v.(*Domain); i {
case 0: case 0:
return &v.state return &v.state
@ -622,7 +626,7 @@ func file_rule_geodata_router_config_proto_init() {
return nil return nil
} }
} }
file_rule_geodata_router_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_component_geodata_router_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CIDR); i { switch v := v.(*CIDR); i {
case 0: case 0:
return &v.state return &v.state
@ -634,7 +638,7 @@ func file_rule_geodata_router_config_proto_init() {
return nil return nil
} }
} }
file_rule_geodata_router_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_component_geodata_router_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GeoIP); i { switch v := v.(*GeoIP); i {
case 0: case 0:
return &v.state return &v.state
@ -646,7 +650,7 @@ func file_rule_geodata_router_config_proto_init() {
return nil return nil
} }
} }
file_rule_geodata_router_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_component_geodata_router_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GeoIPList); i { switch v := v.(*GeoIPList); i {
case 0: case 0:
return &v.state return &v.state
@ -658,7 +662,7 @@ func file_rule_geodata_router_config_proto_init() {
return nil return nil
} }
} }
file_rule_geodata_router_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_component_geodata_router_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GeoSite); i { switch v := v.(*GeoSite); i {
case 0: case 0:
return &v.state return &v.state
@ -670,7 +674,7 @@ func file_rule_geodata_router_config_proto_init() {
return nil return nil
} }
} }
file_rule_geodata_router_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_component_geodata_router_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GeoSiteList); i { switch v := v.(*GeoSiteList); i {
case 0: case 0:
return &v.state return &v.state
@ -682,7 +686,7 @@ func file_rule_geodata_router_config_proto_init() {
return nil return nil
} }
} }
file_rule_geodata_router_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_component_geodata_router_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Domain_Attribute); i { switch v := v.(*Domain_Attribute); i {
case 0: case 0:
return &v.state return &v.state
@ -695,7 +699,7 @@ func file_rule_geodata_router_config_proto_init() {
} }
} }
} }
file_rule_geodata_router_config_proto_msgTypes[6].OneofWrappers = []interface{}{ file_component_geodata_router_config_proto_msgTypes[6].OneofWrappers = []interface{}{
(*Domain_Attribute_BoolValue)(nil), (*Domain_Attribute_BoolValue)(nil),
(*Domain_Attribute_IntValue)(nil), (*Domain_Attribute_IntValue)(nil),
} }
@ -703,19 +707,19 @@ func file_rule_geodata_router_config_proto_init() {
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_rule_geodata_router_config_proto_rawDesc, RawDescriptor: file_component_geodata_router_config_proto_rawDesc,
NumEnums: 1, NumEnums: 1,
NumMessages: 7, NumMessages: 7,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },
GoTypes: file_rule_geodata_router_config_proto_goTypes, GoTypes: file_component_geodata_router_config_proto_goTypes,
DependencyIndexes: file_rule_geodata_router_config_proto_depIdxs, DependencyIndexes: file_component_geodata_router_config_proto_depIdxs,
EnumInfos: file_rule_geodata_router_config_proto_enumTypes, EnumInfos: file_component_geodata_router_config_proto_enumTypes,
MessageInfos: file_rule_geodata_router_config_proto_msgTypes, MessageInfos: file_component_geodata_router_config_proto_msgTypes,
}.Build() }.Build()
File_rule_geodata_router_config_proto = out.File File_component_geodata_router_config_proto = out.File
file_rule_geodata_router_config_proto_rawDesc = nil file_component_geodata_router_config_proto_rawDesc = nil
file_rule_geodata_router_config_proto_goTypes = nil file_component_geodata_router_config_proto_goTypes = nil
file_rule_geodata_router_config_proto_depIdxs = nil file_component_geodata_router_config_proto_depIdxs = nil
} }

View file

@ -1,9 +1,9 @@
syntax = "proto3"; syntax = "proto3";
package clash.rule.geodata.router; package clash.component.geodata.router;
option csharp_namespace = "Clash.Rule.Geodata.Router"; option csharp_namespace = "Clash.Component.Geodata.Router";
option go_package = "github.com/Dreamacro/clash/rule/geodata/router"; option go_package = "github.com/Dreamacro/clash/component/geodata/router";
option java_package = "com.clash.rule.geodata.router"; option java_package = "com.clash.component.geodata.router";
option java_multiple_files = true; option java_multiple_files = true;
// Domain for routing decision. // Domain for routing decision.

View file

@ -6,9 +6,9 @@ import (
"os" "os"
"strings" "strings"
"github.com/Dreamacro/clash/component/geodata"
"github.com/Dreamacro/clash/component/geodata/router"
C "github.com/Dreamacro/clash/constant" C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/rule/geodata"
"github.com/Dreamacro/clash/rule/geodata/router"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
@ -17,7 +17,9 @@ func ReadFile(path string) ([]byte, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer reader.Close() defer func(reader *os.File) {
_ = reader.Close()
}(reader)
return io.ReadAll(reader) return io.ReadAll(reader)
} }

View file

@ -315,9 +315,9 @@ func NewClashPyContext(ruleProvidersName []string) error {
cArrPointer = unsafe.Pointer(&cStringArr[0]) cArrPointer = unsafe.Pointer(&cStringArr[0])
} }
rs := int(C.new_clash_py_context((**C.char)(cArrPointer), C.int(length))) rs := C.new_clash_py_context((**C.char)(cArrPointer), C.int(length))
if rs == 0 { if int(rs) == 0 {
err := PyLastError() err := PyLastError()
return fmt.Errorf("new script module context failure: %s", err.Error()) return fmt.Errorf("new script module context failure: %s", err.Error())
} }

View file

@ -46,7 +46,7 @@ func init() {
} }
func main() { func main() {
maxprocs.Set(maxprocs.Logger(func(string, ...interface{}) {})) _, _ = maxprocs.Set(maxprocs.Logger(func(string, ...interface{}) {}))
if version { if version {
fmt.Printf("Clash Plus Pro %s %s %s with %s %s\n", C.Version, runtime.GOOS, runtime.GOARCH, runtime.Version(), C.BuildTime) fmt.Printf("Clash Plus Pro %s %s %s with %s %s\n", C.Version, runtime.GOOS, runtime.GOARCH, runtime.Version(), C.BuildTime)
return return

View file

@ -3,12 +3,12 @@ package rules
import ( import (
"fmt" "fmt"
"github.com/Dreamacro/clash/component/geodata"
"github.com/Dreamacro/clash/component/geodata/router"
C "github.com/Dreamacro/clash/constant" C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/log" "github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/rule/geodata"
//_ "github.com/Dreamacro/clash/rule/geodata/memconservative" _ "github.com/Dreamacro/clash/component/geodata/standard"
"github.com/Dreamacro/clash/rule/geodata/router"
_ "github.com/Dreamacro/clash/rule/geodata/standard"
) )
type GEOSITE struct { type GEOSITE struct {