Documentation ¶
Index ¶
- Variables
- type CIDR
- type CIDRList
- type Domain
- func (*Domain) Descriptor() ([]byte, []int)deprecated
- func (x *Domain) GetAttribute() []*Domain_Attribute
- func (x *Domain) GetType() Domain_Type
- func (x *Domain) GetValue() string
- func (*Domain) ProtoMessage()
- func (x *Domain) ProtoReflect() protoreflect.Message
- func (x *Domain) Reset()
- func (x *Domain) String() string
- type DomainMatcher
- type Domain_Attribute
- func (*Domain_Attribute) Descriptor() ([]byte, []int)deprecated
- func (x *Domain_Attribute) GetBoolValue() bool
- func (x *Domain_Attribute) GetIntValue() int64
- func (x *Domain_Attribute) GetKey() string
- func (m *Domain_Attribute) GetTypedValue() isDomain_Attribute_TypedValue
- func (*Domain_Attribute) ProtoMessage()
- func (x *Domain_Attribute) ProtoReflect() protoreflect.Message
- func (x *Domain_Attribute) Reset()
- func (x *Domain_Attribute) String() string
- type Domain_Attribute_BoolValue
- type Domain_Attribute_IntValue
- type Domain_Type
- func (Domain_Type) Descriptor() protoreflect.EnumDescriptor
- func (x Domain_Type) Enum() *Domain_Type
- func (Domain_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x Domain_Type) Number() protoreflect.EnumNumber
- func (x Domain_Type) String() string
- func (Domain_Type) Type() protoreflect.EnumType
- type GeoIP
- func (*GeoIP) Descriptor() ([]byte, []int)deprecated
- func (x *GeoIP) GetCidr() []*CIDR
- func (x *GeoIP) GetCountryCode() string
- func (x *GeoIP) GetReverseMatch() bool
- func (*GeoIP) ProtoMessage()
- func (x *GeoIP) ProtoReflect() protoreflect.Message
- func (x *GeoIP) Reset()
- func (x *GeoIP) String() string
- type GeoIPList
- type GeoIPMatcher
- type GeoIPMatcherContainer
- type GeoSite
- type GeoSiteList
- type MultiGeoIPMatcher
Constants ¶
This section is empty.
Variables ¶
var ( Domain_Type_name = map[int32]string{ 0: "Plain", 1: "Regex", 2: "Domain", 3: "Full", } Domain_Type_value = map[string]int32{ "Plain": 0, "Regex": 1, "Domain": 2, "Full": 3, } )
Enum value maps for Domain_Type.
var File_component_geodata_router_config_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type CIDR ¶
type CIDR struct { // IP address, should be either 4 or 16 bytes. Ip []byte `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` // Number of leading ones in the network mask. Prefix uint32 `protobuf:"varint,2,opt,name=prefix,proto3" json:"prefix,omitempty"` // contains filtered or unexported fields }
IP for routing decision, in CIDR form.
func (*CIDR) Descriptor
deprecated
func (*CIDR) ProtoMessage ¶
func (*CIDR) ProtoMessage()
func (*CIDR) ProtoReflect ¶
func (x *CIDR) ProtoReflect() protoreflect.Message
type Domain ¶
type Domain struct { // Domain matching type. Type Domain_Type `protobuf:"varint,1,opt,name=type,proto3,enum=clash.component.geodata.router.Domain_Type" json:"type,omitempty"` // Domain value. Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // Attributes of this domain. May be used for filtering. Attribute []*Domain_Attribute `protobuf:"bytes,3,rep,name=attribute,proto3" json:"attribute,omitempty"` // contains filtered or unexported fields }
Domain for routing decision.
func (*Domain) Descriptor
deprecated
func (*Domain) GetAttribute ¶
func (x *Domain) GetAttribute() []*Domain_Attribute
func (*Domain) GetType ¶
func (x *Domain) GetType() Domain_Type
func (*Domain) ProtoMessage ¶
func (*Domain) ProtoMessage()
func (*Domain) ProtoReflect ¶
func (x *Domain) ProtoReflect() protoreflect.Message
type DomainMatcher ¶
type DomainMatcher struct {
// contains filtered or unexported fields
}
func NewDomainMatcher ¶
func NewDomainMatcher(domains []*Domain, not bool) (*DomainMatcher, error)
NewDomainMatcher new domain matcher.
func NewMphMatcherGroup ¶
func NewMphMatcherGroup(domains []*Domain, not bool) (*DomainMatcher, error)
func (*DomainMatcher) ApplyDomain ¶
func (m *DomainMatcher) ApplyDomain(domain string) bool
type Domain_Attribute ¶
type Domain_Attribute struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // Types that are assignable to TypedValue: // *Domain_Attribute_BoolValue // *Domain_Attribute_IntValue TypedValue isDomain_Attribute_TypedValue `protobuf_oneof:"typed_value"` // contains filtered or unexported fields }
func (*Domain_Attribute) Descriptor
deprecated
func (*Domain_Attribute) Descriptor() ([]byte, []int)
Deprecated: Use Domain_Attribute.ProtoReflect.Descriptor instead.
func (*Domain_Attribute) GetBoolValue ¶
func (x *Domain_Attribute) GetBoolValue() bool
func (*Domain_Attribute) GetIntValue ¶
func (x *Domain_Attribute) GetIntValue() int64
func (*Domain_Attribute) GetKey ¶
func (x *Domain_Attribute) GetKey() string
func (*Domain_Attribute) GetTypedValue ¶
func (m *Domain_Attribute) GetTypedValue() isDomain_Attribute_TypedValue
func (*Domain_Attribute) ProtoMessage ¶
func (*Domain_Attribute) ProtoMessage()
func (*Domain_Attribute) ProtoReflect ¶
func (x *Domain_Attribute) ProtoReflect() protoreflect.Message
func (*Domain_Attribute) Reset ¶
func (x *Domain_Attribute) Reset()
func (*Domain_Attribute) String ¶
func (x *Domain_Attribute) String() string
type Domain_Attribute_BoolValue ¶
type Domain_Attribute_BoolValue struct {
BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"`
}
type Domain_Attribute_IntValue ¶
type Domain_Attribute_IntValue struct {
IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"`
}
type Domain_Type ¶
type Domain_Type int32
Type of domain value.
const ( // The value is used as is. Domain_Plain Domain_Type = 0 // The value is used as a regular expression. Domain_Regex Domain_Type = 1 // The value is a root domain. Domain_Domain Domain_Type = 2 // The value is a domain. Domain_Full Domain_Type = 3 )
func (Domain_Type) Descriptor ¶
func (Domain_Type) Descriptor() protoreflect.EnumDescriptor
func (Domain_Type) Enum ¶
func (x Domain_Type) Enum() *Domain_Type
func (Domain_Type) EnumDescriptor
deprecated
func (Domain_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use Domain_Type.Descriptor instead.
func (Domain_Type) Number ¶
func (x Domain_Type) Number() protoreflect.EnumNumber
func (Domain_Type) String ¶
func (x Domain_Type) String() string
func (Domain_Type) Type ¶
func (Domain_Type) Type() protoreflect.EnumType
type GeoIP ¶
type GeoIP struct { CountryCode string `protobuf:"bytes,1,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"` Cidr []*CIDR `protobuf:"bytes,2,rep,name=cidr,proto3" json:"cidr,omitempty"` ReverseMatch bool `protobuf:"varint,3,opt,name=reverse_match,json=reverseMatch,proto3" json:"reverse_match,omitempty"` // contains filtered or unexported fields }
func (*GeoIP) Descriptor
deprecated
func (*GeoIP) GetCountryCode ¶
func (*GeoIP) GetReverseMatch ¶
func (*GeoIP) ProtoMessage ¶
func (*GeoIP) ProtoMessage()
func (*GeoIP) ProtoReflect ¶
func (x *GeoIP) ProtoReflect() protoreflect.Message
type GeoIPList ¶
type GeoIPList struct { Entry []*GeoIP `protobuf:"bytes,1,rep,name=entry,proto3" json:"entry,omitempty"` // contains filtered or unexported fields }
func (*GeoIPList) Descriptor
deprecated
func (*GeoIPList) ProtoMessage ¶
func (*GeoIPList) ProtoMessage()
func (*GeoIPList) ProtoReflect ¶
func (x *GeoIPList) ProtoReflect() protoreflect.Message
type GeoIPMatcher ¶
type GeoIPMatcher struct {
// contains filtered or unexported fields
}
func NewGeoIPMatcher ¶
func NewGeoIPMatcher(geoip *GeoIP) (*GeoIPMatcher, error)
func (*GeoIPMatcher) Init ¶
func (m *GeoIPMatcher) Init(cidrs []*CIDR) error
func (*GeoIPMatcher) Match ¶
func (m *GeoIPMatcher) Match(ip net.IP) bool
Match returns true if the given ip is included by the GeoIP.
func (*GeoIPMatcher) SetReverseMatch ¶
func (m *GeoIPMatcher) SetReverseMatch(isReverseMatch bool)
type GeoIPMatcherContainer ¶
type GeoIPMatcherContainer struct {
// contains filtered or unexported fields
}
GeoIPMatcherContainer is a container for GeoIPMatchers. It keeps unique copies of GeoIPMatcher by country code.
func (*GeoIPMatcherContainer) Add ¶
func (c *GeoIPMatcherContainer) Add(geoip *GeoIP) (*GeoIPMatcher, error)
Add adds a new GeoIP set into the container. If the country code of GeoIP is not empty, GeoIPMatcherContainer will try to find an existing one, instead of adding a new one.
type GeoSite ¶
type GeoSite struct { CountryCode string `protobuf:"bytes,1,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"` Domain []*Domain `protobuf:"bytes,2,rep,name=domain,proto3" json:"domain,omitempty"` // contains filtered or unexported fields }
func (*GeoSite) Descriptor
deprecated
func (*GeoSite) GetCountryCode ¶
func (*GeoSite) ProtoMessage ¶
func (*GeoSite) ProtoMessage()
func (*GeoSite) ProtoReflect ¶
func (x *GeoSite) ProtoReflect() protoreflect.Message
type GeoSiteList ¶
type GeoSiteList struct { Entry []*GeoSite `protobuf:"bytes,1,rep,name=entry,proto3" json:"entry,omitempty"` // contains filtered or unexported fields }
func (*GeoSiteList) Descriptor
deprecated
func (*GeoSiteList) Descriptor() ([]byte, []int)
Deprecated: Use GeoSiteList.ProtoReflect.Descriptor instead.
func (*GeoSiteList) GetEntry ¶
func (x *GeoSiteList) GetEntry() []*GeoSite
func (*GeoSiteList) ProtoMessage ¶
func (*GeoSiteList) ProtoMessage()
func (*GeoSiteList) ProtoReflect ¶
func (x *GeoSiteList) ProtoReflect() protoreflect.Message
func (*GeoSiteList) Reset ¶
func (x *GeoSiteList) Reset()
func (*GeoSiteList) String ¶
func (x *GeoSiteList) String() string
type MultiGeoIPMatcher ¶
type MultiGeoIPMatcher struct {
// contains filtered or unexported fields
}
func NewMultiGeoIPMatcher ¶
func NewMultiGeoIPMatcher(geoips []*GeoIP) (*MultiGeoIPMatcher, error)