Documentation
¶
Index ¶
- Constants
- func ASNEnable() bool
- func ASNUrl() string
- func ClearGeoIPCache()
- func ClearGeoSiteCache()
- func CompileGeoIP(country string) error
- func CompileGeoSite(category string) error
- func CompiledGeoIPDir() string
- func CompiledGeoIPOnly() bool
- func CompiledGeoSiteDir() string
- func CompiledGeoSiteKey(category string) (string, error)
- func CompiledGeoSiteOnly() bool
- func CountGeoIP(country string) (int, error)
- func CountGeoSite(category string) (int, error)
- func GeoIpEnable() bool
- func GeoIpUrl() string
- func GeoSiteEnable() bool
- func GeoSiteUrl() string
- func GeodataMode() bool
- func GeodataProgressReporter() func(string)
- func InitASN() error
- func InitGeoIP() error
- func InitGeoSite() error
- func LoadGeoIPMatcher(country string) (router.IPMatcher, error)
- func LoadGeoSiteMatcher(countryCode string) (router.DomainMatcher, error)
- func LoaderName() string
- func MarkGeoSiteVerified()
- func MmdbUrl() string
- func RegisterGeoDataLoaderImplementationCreator(name string, loader func() LoaderImplementation)
- func SetASNUrl(url string)
- func SetCompiledGeoIPOnly(only bool)
- func SetCompiledGeoSiteOnly(only bool)
- func SetGeoIpUrl(url string)
- func SetGeoSiteUrl(url string)
- func SetGeodataMode(newGeodataMode bool)
- func SetGeodataProgressReporter(report func(string))
- func SetLoader(newLoader string)
- func SetMmdbUrl(url string)
- func SetSiteMatcher(newMatcher string)
- func SiteMatcherName() string
- func Verify(name string) error
- type AttributeList
- type AttributeMatcher
- type BooleanMatcher
- type Loader
- type LoaderImplementation
Constants ¶
View Source
const ( MaxMMDBBytes int64 = 64 << 20 MaxDatFileBytes int64 = 128 << 20 )
Variables ¶
This section is empty.
Functions ¶
func ClearGeoIPCache ¶
func ClearGeoIPCache()
func ClearGeoSiteCache ¶
func ClearGeoSiteCache()
func CompileGeoIP ¶
func CompileGeoSite ¶
func CompiledGeoIPDir ¶
func CompiledGeoIPDir() string
func CompiledGeoIPOnly ¶
func CompiledGeoIPOnly() bool
func CompiledGeoSiteDir ¶
func CompiledGeoSiteDir() string
func CompiledGeoSiteKey ¶
func CompiledGeoSiteOnly ¶
func CompiledGeoSiteOnly() bool
func CountGeoIP ¶
func CountGeoSite ¶
func GeoIpEnable ¶
func GeoIpEnable() bool
func GeoSiteEnable ¶
func GeoSiteEnable() bool
func GeoSiteUrl ¶
func GeoSiteUrl() string
func GeodataMode ¶
func GeodataMode() bool
func GeodataProgressReporter ¶
func GeodataProgressReporter() func(string)
func InitGeoSite ¶
func InitGeoSite() error
func LoadGeoSiteMatcher ¶
func LoadGeoSiteMatcher(countryCode string) (router.DomainMatcher, error)
func LoaderName ¶
func LoaderName() string
func MarkGeoSiteVerified ¶
func MarkGeoSiteVerified()
func RegisterGeoDataLoaderImplementationCreator ¶
func RegisterGeoDataLoaderImplementationCreator(name string, loader func() LoaderImplementation)
func SetCompiledGeoIPOnly ¶
func SetCompiledGeoIPOnly(only bool)
func SetCompiledGeoSiteOnly ¶
func SetCompiledGeoSiteOnly(only bool)
func SetGeoIpUrl ¶
func SetGeoIpUrl(url string)
func SetGeoSiteUrl ¶
func SetGeoSiteUrl(url string)
func SetGeodataMode ¶
func SetGeodataMode(newGeodataMode bool)
func SetGeodataProgressReporter ¶
func SetGeodataProgressReporter(report func(string))
func SetMmdbUrl ¶
func SetMmdbUrl(url string)
func SetSiteMatcher ¶
func SetSiteMatcher(newMatcher string)
func SiteMatcherName ¶
func SiteMatcherName() string
Types ¶
type AttributeList ¶
type AttributeList struct {
// contains filtered or unexported fields
}
func (*AttributeList) IsEmpty ¶
func (al *AttributeList) IsEmpty() bool
func (*AttributeList) String ¶
func (al *AttributeList) String() string
type AttributeMatcher ¶
type BooleanMatcher ¶
type BooleanMatcher string
type Loader ¶
type Loader interface {
LoaderImplementation
LoadGeoSite(list string) ([]*router.Domain, error)
LoadGeoIP(country string) ([]*router.CIDR, error)
}
func GetGeoDataLoader ¶
type LoaderImplementation ¶
type LoaderImplementation interface {
LoadSiteByPath(filename, list string) ([]*router.Domain, error)
LoadSiteByBytes(geositeBytes []byte, list string) ([]*router.Domain, error)
LoadIPByPath(filename, country string) ([]*router.CIDR, error)
LoadIPByBytes(geoipBytes []byte, country string) ([]*router.CIDR, error)
}
Click to show internal directories.
Click to hide internal directories.