Documentation ¶
Index ¶
- Variables
- func LoadFromV2CIDR(l *netlist.List, cidr []*CIDR) error
- func LoadMixMatcherFromDAT(m *domain.MixMatcher, file, countryCode string, ...) error
- func LoadNetListFromDAT(l *netlist.List, file, tag string) error
- type CIDR
- 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 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
- type GeoIPList
- type GeoSite
- type GeoSiteList
Constants ¶
This section is empty.
Variables ¶
View Source
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.
View Source
var File_dispatcher_pkg_matcher_v2data_data_proto protoreflect.FileDescriptor
Functions ¶
func LoadFromV2CIDR ¶
LoadFromV2CIDR loads ip from v2ray CIDR. It might modify the List and causes List unsorted.
func LoadMixMatcherFromDAT ¶
func LoadMixMatcherFromDAT(m *domain.MixMatcher, file, countryCode string, processAttr domain.ProcessAttrFunc) error
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=v2data.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 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"` // contains filtered or unexported fields }
func LoadGeoIPFromDAT ¶
func (*GeoIP) Descriptor
deprecated
func (*GeoIP) GetCountryCode ¶
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 LoadGeoIPListFromDAT ¶
func (*GeoIPList) Descriptor
deprecated
func (*GeoIPList) ProtoMessage ¶
func (*GeoIPList) ProtoMessage()
func (*GeoIPList) ProtoReflect ¶
func (x *GeoIPList) ProtoReflect() protoreflect.Message
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 LoadGeoSiteFromDAT ¶
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 LoadGeoSiteList ¶
func LoadGeoSiteList(file string) (*GeoSiteList, error)
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
Click to show internal directories.
Click to hide internal directories.