Documentation
¶
Index ¶
- Variables
- func AppSetConfigToAppSet(c *configs.AppSetConfig, l loader) (i.AppSet, error)
- func AtomicDomainSetToIndexMatcher(atomicSet *configs.AtomicDomainSetConfig, l loader) (strmatcher.IndexMatcher, error)
- func AtomicIpSetToIPMatcher(c *configs.AtomicIPSetConfig, l loader) (*cgeo.IPMatcher, error)
- func GeoIpConfigToCidrs(config *configs.GeoIPConfig, l loader) ([]*cgeo.CIDR, error)
- func GeositeConfigToGeoDomains(c *configs.GeositeConfig, l loader) ([]*cgeo.Domain, error)
- func ToStrMatcher(d *configs.AppId) (strmatcher.Matcher, error)
- type AppSet
- type AtomicDomainSetConfig
- func (*AtomicDomainSetConfig) Descriptor() ([]byte, []int)deprecated
- func (x *AtomicDomainSetConfig) GetDomains() []*geo.Domain
- func (x *AtomicDomainSetConfig) GetGeosite() *GeositeConfig
- func (x *AtomicDomainSetConfig) GetName() string
- func (*AtomicDomainSetConfig) ProtoMessage()
- func (x *AtomicDomainSetConfig) ProtoReflect() protoreflect.Message
- func (x *AtomicDomainSetConfig) Reset()
- func (x *AtomicDomainSetConfig) String() string
- type AtomicIPSetConfig
- func (*AtomicIPSetConfig) Descriptor() ([]byte, []int)deprecated
- func (x *AtomicIPSetConfig) GetCidrs() []*geo.CIDR
- func (x *AtomicIPSetConfig) GetGeoip() *GeoIPConfig
- func (x *AtomicIPSetConfig) GetName() string
- func (*AtomicIPSetConfig) ProtoMessage()
- func (x *AtomicIPSetConfig) ProtoReflect() protoreflect.Message
- func (x *AtomicIPSetConfig) Reset()
- func (x *AtomicIPSetConfig) String() string
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetAtomicDomainSets() []*AtomicDomainSetConfig
- func (x *Config) GetAtomicIpSets() []*AtomicIPSetConfig
- func (x *Config) GetGreatDomainSets() []*GreatDomainSetConfig
- func (x *Config) GetGreatIpSets() []*GreatIPSetConfig
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- type DomainSet
- type Geo
- type GeoIPConfig
- func (*GeoIPConfig) Descriptor() ([]byte, []int)deprecated
- func (x *GeoIPConfig) GetCodes() []string
- func (x *GeoIPConfig) GetFilepath() string
- func (x *GeoIPConfig) GetInverse() bool
- func (*GeoIPConfig) ProtoMessage()
- func (x *GeoIPConfig) ProtoReflect() protoreflect.Message
- func (x *GeoIPConfig) Reset()
- func (x *GeoIPConfig) String() string
- type GeoWrapper
- func (g *GeoWrapper) AddDomainSet(name string, set i.DomainSet)
- func (g *GeoWrapper) AddIPSet(name string, set i.IPSet)
- func (g *GeoWrapper) GetGeo() *Geo
- func (g *GeoWrapper) MatchAppId(appId string, tag string) bool
- func (g *GeoWrapper) MatchDomain(domain string, tag string) bool
- func (g *GeoWrapper) MatchIP(ip net.IP, tag string) bool
- func (g *GeoWrapper) UpdateGeo(geoConfig *configs.GeoConfig) error
- type GeositeConfig
- func (*GeositeConfig) Descriptor() ([]byte, []int)deprecated
- func (x *GeositeConfig) GetAttributes() []string
- func (x *GeositeConfig) GetCodes() []string
- func (x *GeositeConfig) GetFilepath() string
- func (*GeositeConfig) ProtoMessage()
- func (x *GeositeConfig) ProtoReflect() protoreflect.Message
- func (x *GeositeConfig) Reset()
- func (x *GeositeConfig) String() string
- type GreatDomainSet
- type GreatDomainSetConfig
- func (*GreatDomainSetConfig) Descriptor() ([]byte, []int)deprecated
- func (x *GreatDomainSetConfig) GetExNames() []string
- func (x *GreatDomainSetConfig) GetInNames() []string
- func (x *GreatDomainSetConfig) GetName() string
- func (x *GreatDomainSetConfig) GetOppositeName() string
- func (*GreatDomainSetConfig) ProtoMessage()
- func (x *GreatDomainSetConfig) ProtoReflect() protoreflect.Message
- func (x *GreatDomainSetConfig) Reset()
- func (x *GreatDomainSetConfig) String() string
- type GreatIPSet
- type GreatIPSetConfig
- func (*GreatIPSetConfig) Descriptor() ([]byte, []int)deprecated
- func (x *GreatIPSetConfig) GetExNames() []string
- func (x *GreatIPSetConfig) GetInNames() []string
- func (x *GreatIPSetConfig) GetName() string
- func (x *GreatIPSetConfig) GetOppositeName() string
- func (*GreatIPSetConfig) ProtoMessage()
- func (x *GreatIPSetConfig) ProtoReflect() protoreflect.Message
- func (x *GreatIPSetConfig) Reset()
- func (x *GreatIPSetConfig) String() string
- type IndexMatcherToDomainSet
- type IpSet
- type NullDomainSet
- type StrmatcherToAppSet
Constants ¶
This section is empty.
Variables ¶
View Source
var File_internal_geo_geo_proto protoreflect.FileDescriptor
Functions ¶
func AppSetConfigToAppSet ¶
func AppSetConfigToAppSet(c *configs.AppSetConfig, l loader) (i.AppSet, error)
func AtomicDomainSetToIndexMatcher ¶
func AtomicDomainSetToIndexMatcher(atomicSet *configs.AtomicDomainSetConfig, l loader) (strmatcher.IndexMatcher, error)
func AtomicIpSetToIPMatcher ¶
func AtomicIpSetToIPMatcher(c *configs.AtomicIPSetConfig, l loader) (*cgeo.IPMatcher, error)
func GeoIpConfigToCidrs ¶
func GeoIpConfigToCidrs(config *configs.GeoIPConfig, l loader) ([]*cgeo.CIDR, error)
func GeositeConfigToGeoDomains ¶
func GeositeConfigToGeoDomains(c *configs.GeositeConfig, l loader) ([]*cgeo.Domain, error)
func ToStrMatcher ¶
func ToStrMatcher(d *configs.AppId) (strmatcher.Matcher, error)
Types ¶
type AtomicDomainSetConfig ¶
type AtomicDomainSetConfig struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// either one of the following two fields should be set
Domains []*geo.Domain `protobuf:"bytes,2,rep,name=domains,proto3" json:"domains,omitempty"`
Geosite *GeositeConfig `protobuf:"bytes,3,opt,name=geosite,proto3" json:"geosite,omitempty"`
// contains filtered or unexported fields
}
func (*AtomicDomainSetConfig) Descriptor
deprecated
func (*AtomicDomainSetConfig) Descriptor() ([]byte, []int)
Deprecated: Use AtomicDomainSetConfig.ProtoReflect.Descriptor instead.
func (*AtomicDomainSetConfig) GetDomains ¶
func (x *AtomicDomainSetConfig) GetDomains() []*geo.Domain
func (*AtomicDomainSetConfig) GetGeosite ¶
func (x *AtomicDomainSetConfig) GetGeosite() *GeositeConfig
func (*AtomicDomainSetConfig) GetName ¶
func (x *AtomicDomainSetConfig) GetName() string
func (*AtomicDomainSetConfig) ProtoMessage ¶
func (*AtomicDomainSetConfig) ProtoMessage()
func (*AtomicDomainSetConfig) ProtoReflect ¶
func (x *AtomicDomainSetConfig) ProtoReflect() protoreflect.Message
func (*AtomicDomainSetConfig) Reset ¶
func (x *AtomicDomainSetConfig) Reset()
func (*AtomicDomainSetConfig) String ¶
func (x *AtomicDomainSetConfig) String() string
type AtomicIPSetConfig ¶
type AtomicIPSetConfig struct {
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Cidrs []*geo.CIDR `protobuf:"bytes,2,rep,name=cidrs,proto3" json:"cidrs,omitempty"`
Geoip *GeoIPConfig `protobuf:"bytes,1,opt,name=geoip,proto3" json:"geoip,omitempty"`
// contains filtered or unexported fields
}
func (*AtomicIPSetConfig) Descriptor
deprecated
func (*AtomicIPSetConfig) Descriptor() ([]byte, []int)
Deprecated: Use AtomicIPSetConfig.ProtoReflect.Descriptor instead.
func (*AtomicIPSetConfig) GetCidrs ¶
func (x *AtomicIPSetConfig) GetCidrs() []*geo.CIDR
func (*AtomicIPSetConfig) GetGeoip ¶
func (x *AtomicIPSetConfig) GetGeoip() *GeoIPConfig
func (*AtomicIPSetConfig) GetName ¶
func (x *AtomicIPSetConfig) GetName() string
func (*AtomicIPSetConfig) ProtoMessage ¶
func (*AtomicIPSetConfig) ProtoMessage()
func (*AtomicIPSetConfig) ProtoReflect ¶
func (x *AtomicIPSetConfig) ProtoReflect() protoreflect.Message
func (*AtomicIPSetConfig) Reset ¶
func (x *AtomicIPSetConfig) Reset()
func (*AtomicIPSetConfig) String ¶
func (x *AtomicIPSetConfig) String() string
type Config ¶
type Config struct {
GreatDomainSets []*GreatDomainSetConfig `protobuf:"bytes,3,rep,name=great_domain_sets,json=greatDomainSets,proto3" json:"great_domain_sets,omitempty"`
GreatIpSets []*GreatIPSetConfig `protobuf:"bytes,4,rep,name=great_ip_sets,json=greatIpSets,proto3" json:"great_ip_sets,omitempty"`
AtomicDomainSets []*AtomicDomainSetConfig `protobuf:"bytes,5,rep,name=atomic_domain_sets,json=atomicDomainSets,proto3" json:"atomic_domain_sets,omitempty"`
AtomicIpSets []*AtomicIPSetConfig `protobuf:"bytes,6,rep,name=atomic_ip_sets,json=atomicIpSets,proto3" json:"atomic_ip_sets,omitempty"`
// contains filtered or unexported fields
}
func (*Config) Descriptor
deprecated
func (*Config) GetAtomicDomainSets ¶
func (x *Config) GetAtomicDomainSets() []*AtomicDomainSetConfig
func (*Config) GetAtomicIpSets ¶
func (x *Config) GetAtomicIpSets() []*AtomicIPSetConfig
func (*Config) GetGreatDomainSets ¶
func (x *Config) GetGreatDomainSets() []*GreatDomainSetConfig
func (*Config) GetGreatIpSets ¶
func (x *Config) GetGreatIpSets() []*GreatIPSetConfig
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
type DomainSet ¶
type DomainSet struct {
// contains filtered or unexported fields
}
func NewDomainSet ¶
type Geo ¶
type Geo struct {
// domain
OppositeDomainTags map[string]string
DomainSets map[string]i.DomainSet
// ip
OppositeIpTags map[string]string
IpSets map[string]i.IPSet
// app
AppSets map[string]i.AppSet
}
type GeoIPConfig ¶
type GeoIPConfig struct {
Filepath string `protobuf:"bytes,1,opt,name=filepath,proto3" json:"filepath,omitempty"`
Codes []string `protobuf:"bytes,2,rep,name=codes,proto3" json:"codes,omitempty"`
Inverse bool `protobuf:"varint,3,opt,name=inverse,proto3" json:"inverse,omitempty"`
// contains filtered or unexported fields
}
func (*GeoIPConfig) Descriptor
deprecated
func (*GeoIPConfig) Descriptor() ([]byte, []int)
Deprecated: Use GeoIPConfig.ProtoReflect.Descriptor instead.
func (*GeoIPConfig) GetCodes ¶
func (x *GeoIPConfig) GetCodes() []string
func (*GeoIPConfig) GetFilepath ¶
func (x *GeoIPConfig) GetFilepath() string
func (*GeoIPConfig) GetInverse ¶
func (x *GeoIPConfig) GetInverse() bool
func (*GeoIPConfig) ProtoMessage ¶
func (*GeoIPConfig) ProtoMessage()
func (*GeoIPConfig) ProtoReflect ¶
func (x *GeoIPConfig) ProtoReflect() protoreflect.Message
func (*GeoIPConfig) Reset ¶
func (x *GeoIPConfig) Reset()
func (*GeoIPConfig) String ¶
func (x *GeoIPConfig) String() string
type GeoWrapper ¶
func (*GeoWrapper) AddDomainSet ¶
func (g *GeoWrapper) AddDomainSet(name string, set i.DomainSet)
func (*GeoWrapper) GetGeo ¶
func (g *GeoWrapper) GetGeo() *Geo
func (*GeoWrapper) MatchAppId ¶
func (g *GeoWrapper) MatchAppId(appId string, tag string) bool
func (*GeoWrapper) MatchDomain ¶
func (g *GeoWrapper) MatchDomain(domain string, tag string) bool
type GeositeConfig ¶
type GeositeConfig struct {
Codes []string `protobuf:"bytes,1,rep,name=codes,proto3" json:"codes,omitempty"`
Attributes []string `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty"`
Filepath string `protobuf:"bytes,3,opt,name=filepath,proto3" json:"filepath,omitempty"`
// contains filtered or unexported fields
}
func (*GeositeConfig) Descriptor
deprecated
func (*GeositeConfig) Descriptor() ([]byte, []int)
Deprecated: Use GeositeConfig.ProtoReflect.Descriptor instead.
func (*GeositeConfig) GetAttributes ¶
func (x *GeositeConfig) GetAttributes() []string
func (*GeositeConfig) GetCodes ¶
func (x *GeositeConfig) GetCodes() []string
func (*GeositeConfig) GetFilepath ¶
func (x *GeositeConfig) GetFilepath() string
func (*GeositeConfig) ProtoMessage ¶
func (*GeositeConfig) ProtoMessage()
func (*GeositeConfig) ProtoReflect ¶
func (x *GeositeConfig) ProtoReflect() protoreflect.Message
func (*GeositeConfig) Reset ¶
func (x *GeositeConfig) Reset()
func (*GeositeConfig) String ¶
func (x *GeositeConfig) String() string
type GreatDomainSet ¶
type GreatDomainSet struct {
// contains filtered or unexported fields
}
func NewGreatDomainSet ¶
func NewGreatDomainSet(im []string, es []string, geo i.GeoHelper) *GreatDomainSet
func (*GreatDomainSet) Match ¶
func (d *GreatDomainSet) Match(domain string) bool
type GreatDomainSetConfig ¶
type GreatDomainSetConfig struct {
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
OppositeName string `protobuf:"bytes,4,opt,name=opposite_name,json=oppositeName,proto3" json:"opposite_name,omitempty"`
ExNames []string `protobuf:"bytes,5,rep,name=ex_names,json=exNames,proto3" json:"ex_names,omitempty"`
InNames []string `protobuf:"bytes,6,rep,name=in_names,json=inNames,proto3" json:"in_names,omitempty"`
// contains filtered or unexported fields
}
func (*GreatDomainSetConfig) Descriptor
deprecated
func (*GreatDomainSetConfig) Descriptor() ([]byte, []int)
Deprecated: Use GreatDomainSetConfig.ProtoReflect.Descriptor instead.
func (*GreatDomainSetConfig) GetExNames ¶
func (x *GreatDomainSetConfig) GetExNames() []string
func (*GreatDomainSetConfig) GetInNames ¶
func (x *GreatDomainSetConfig) GetInNames() []string
func (*GreatDomainSetConfig) GetName ¶
func (x *GreatDomainSetConfig) GetName() string
func (*GreatDomainSetConfig) GetOppositeName ¶
func (x *GreatDomainSetConfig) GetOppositeName() string
func (*GreatDomainSetConfig) ProtoMessage ¶
func (*GreatDomainSetConfig) ProtoMessage()
func (*GreatDomainSetConfig) ProtoReflect ¶
func (x *GreatDomainSetConfig) ProtoReflect() protoreflect.Message
func (*GreatDomainSetConfig) Reset ¶
func (x *GreatDomainSetConfig) Reset()
func (*GreatDomainSetConfig) String ¶
func (x *GreatDomainSetConfig) String() string
type GreatIPSet ¶
type GreatIPSet struct {
InMatchers ipSets
ExMatcher ipSets
}
func NewGreatIPSet ¶
func NewGreatIPSet(im []i.IPSet, es []i.IPSet) *GreatIPSet
type GreatIPSetConfig ¶
type GreatIPSetConfig struct {
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
OppositeName string `protobuf:"bytes,4,opt,name=opposite_name,json=oppositeName,proto3" json:"opposite_name,omitempty"`
ExNames []string `protobuf:"bytes,5,rep,name=ex_names,json=exNames,proto3" json:"ex_names,omitempty"`
InNames []string `protobuf:"bytes,6,rep,name=in_names,json=inNames,proto3" json:"in_names,omitempty"`
// contains filtered or unexported fields
}
func (*GreatIPSetConfig) Descriptor
deprecated
func (*GreatIPSetConfig) Descriptor() ([]byte, []int)
Deprecated: Use GreatIPSetConfig.ProtoReflect.Descriptor instead.
func (*GreatIPSetConfig) GetExNames ¶
func (x *GreatIPSetConfig) GetExNames() []string
func (*GreatIPSetConfig) GetInNames ¶
func (x *GreatIPSetConfig) GetInNames() []string
func (*GreatIPSetConfig) GetName ¶
func (x *GreatIPSetConfig) GetName() string
func (*GreatIPSetConfig) GetOppositeName ¶
func (x *GreatIPSetConfig) GetOppositeName() string
func (*GreatIPSetConfig) ProtoMessage ¶
func (*GreatIPSetConfig) ProtoMessage()
func (*GreatIPSetConfig) ProtoReflect ¶
func (x *GreatIPSetConfig) ProtoReflect() protoreflect.Message
func (*GreatIPSetConfig) Reset ¶
func (x *GreatIPSetConfig) Reset()
func (*GreatIPSetConfig) String ¶
func (x *GreatIPSetConfig) String() string
type IndexMatcherToDomainSet ¶
type IndexMatcherToDomainSet struct {
strmatcher.IndexMatcher
// contains filtered or unexported fields
}
func (*IndexMatcherToDomainSet) Match ¶
func (i *IndexMatcherToDomainSet) Match(domain string) bool
type NullDomainSet ¶
type NullDomainSet struct{}
func (*NullDomainSet) Match ¶
func (d *NullDomainSet) Match(domain string) bool
type StrmatcherToAppSet ¶
type StrmatcherToAppSet struct {
strmatcher.IndexMatcher
}
func (*StrmatcherToAppSet) Match ¶
func (m *StrmatcherToAppSet) Match(appId string) bool
Click to show internal directories.
Click to hide internal directories.