v2data

package
Version: v1.8.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2021 License: GPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

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 added in v1.8.4

func LoadFromV2CIDR(l *netlist.List, cidr []*CIDR) error

LoadFromV2CIDR loads ip from v2ray CIDR. It might modify the List and causes List unsorted.

func LoadMixMatcherFromDAT added in v1.8.4

func LoadMixMatcherFromDAT(m *domain.MixMatcher, file, countryCode string, processAttr domain.ProcessAttrFunc) error

func LoadNetListFromDAT added in v1.8.4

func LoadNetListFromDAT(l *netlist.List, file, tag string) error

LoadNetListFromDAT loads ip from v2ray proto file. It might modify the List and causes List unsorted.

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) Descriptor() ([]byte, []int)

Deprecated: Use CIDR.ProtoReflect.Descriptor instead.

func (*CIDR) GetIp

func (x *CIDR) GetIp() []byte

func (*CIDR) GetPrefix

func (x *CIDR) GetPrefix() uint32

func (*CIDR) ProtoMessage

func (*CIDR) ProtoMessage()

func (*CIDR) ProtoReflect

func (x *CIDR) ProtoReflect() protoreflect.Message

func (*CIDR) Reset

func (x *CIDR) Reset()

func (*CIDR) String

func (x *CIDR) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Domain.ProtoReflect.Descriptor instead.

func (*Domain) GetAttribute

func (x *Domain) GetAttribute() []*Domain_Attribute

func (*Domain) GetType

func (x *Domain) GetType() Domain_Type

func (*Domain) GetValue

func (x *Domain) GetValue() string

func (*Domain) ProtoMessage

func (*Domain) ProtoMessage()

func (*Domain) ProtoReflect

func (x *Domain) ProtoReflect() protoreflect.Message

func (*Domain) Reset

func (x *Domain) Reset()

func (*Domain) String

func (x *Domain) String() string

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) 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

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 added in v1.8.4

func LoadGeoIPFromDAT(file, tag string) (*GeoIP, error)

func (*GeoIP) Descriptor deprecated

func (*GeoIP) Descriptor() ([]byte, []int)

Deprecated: Use GeoIP.ProtoReflect.Descriptor instead.

func (*GeoIP) GetCidr

func (x *GeoIP) GetCidr() []*CIDR

func (*GeoIP) GetCountryCode

func (x *GeoIP) GetCountryCode() string

func (*GeoIP) ProtoMessage

func (*GeoIP) ProtoMessage()

func (*GeoIP) ProtoReflect

func (x *GeoIP) ProtoReflect() protoreflect.Message

func (*GeoIP) Reset

func (x *GeoIP) Reset()

func (*GeoIP) String

func (x *GeoIP) String() string

type GeoIPList

type GeoIPList struct {
	Entry []*GeoIP `protobuf:"bytes,1,rep,name=entry,proto3" json:"entry,omitempty"`
	// contains filtered or unexported fields
}

func LoadGeoIPListFromDAT added in v1.8.4

func LoadGeoIPListFromDAT(file string) (*GeoIPList, error)

func (*GeoIPList) Descriptor deprecated

func (*GeoIPList) Descriptor() ([]byte, []int)

Deprecated: Use GeoIPList.ProtoReflect.Descriptor instead.

func (*GeoIPList) GetEntry

func (x *GeoIPList) GetEntry() []*GeoIP

func (*GeoIPList) ProtoMessage

func (*GeoIPList) ProtoMessage()

func (*GeoIPList) ProtoReflect

func (x *GeoIPList) ProtoReflect() protoreflect.Message

func (*GeoIPList) Reset

func (x *GeoIPList) Reset()

func (*GeoIPList) String

func (x *GeoIPList) String() string

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 added in v1.8.4

func LoadGeoSiteFromDAT(file, countryCode string) (*GeoSite, error)

func (*GeoSite) Descriptor deprecated

func (*GeoSite) Descriptor() ([]byte, []int)

Deprecated: Use GeoSite.ProtoReflect.Descriptor instead.

func (*GeoSite) GetCountryCode

func (x *GeoSite) GetCountryCode() string

func (*GeoSite) GetDomain

func (x *GeoSite) GetDomain() []*Domain

func (*GeoSite) ProtoMessage

func (*GeoSite) ProtoMessage()

func (*GeoSite) ProtoReflect

func (x *GeoSite) ProtoReflect() protoreflect.Message

func (*GeoSite) Reset

func (x *GeoSite) Reset()

func (*GeoSite) String

func (x *GeoSite) String() string

type GeoSiteList

type GeoSiteList struct {
	Entry []*GeoSite `protobuf:"bytes,1,rep,name=entry,proto3" json:"entry,omitempty"`
	// contains filtered or unexported fields
}

func LoadGeoSiteList added in v1.8.4

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL