geodata

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ASNEnable added in v1.18.9

func ASNEnable() bool

func ASNUrl added in v1.18.9

func ASNUrl() string

func ClearGeoIPCache added in v1.18.9

func ClearGeoIPCache()

func ClearGeoSiteCache added in v1.18.9

func ClearGeoSiteCache()

func GeoIpEnable added in v1.18.9

func GeoIpEnable() bool

func GeoIpUrl added in v1.18.9

func GeoIpUrl() string

func GeoSiteEnable added in v1.18.9

func GeoSiteEnable() bool

func GeoSiteUrl added in v1.18.9

func GeoSiteUrl() string

func GeodataMode added in v1.18.2

func GeodataMode() bool

func InitASN added in v1.18.2

func InitASN() error

func InitGeoIP

func InitGeoIP() error

func InitGeoSite

func InitGeoSite() error

func LoadGeoIPMatcher

func LoadGeoIPMatcher(country string) (router.IPMatcher, error)

func LoadGeoSiteMatcher

func LoadGeoSiteMatcher(countryCode string) (router.DomainMatcher, error)

func LoaderName

func LoaderName() string

func MmdbUrl added in v1.18.9

func MmdbUrl() string

func RegisterGeoDataLoaderImplementationCreator

func RegisterGeoDataLoaderImplementationCreator(name string, loader func() LoaderImplementation)

func SetASNUrl added in v1.18.9

func SetASNUrl(url string)

func SetGeoIpUrl added in v1.18.9

func SetGeoIpUrl(url string)

func SetGeoSiteUrl added in v1.18.9

func SetGeoSiteUrl(url string)

func SetGeodataMode added in v1.18.2

func SetGeodataMode(newGeodataMode bool)

func SetLoader

func SetLoader(newLoader string)

func SetMmdbUrl added in v1.18.9

func SetMmdbUrl(url string)

func SetSiteMatcher added in v1.18.0

func SetSiteMatcher(newMatcher string)

func SiteMatcherName added in v1.18.0

func SiteMatcherName() string

func Verify

func Verify(name string) error

Types

type AttributeList

type AttributeList struct {
	// contains filtered or unexported fields
}

func (*AttributeList) IsEmpty

func (al *AttributeList) IsEmpty() bool

func (*AttributeList) Match

func (al *AttributeList) Match(domain *router.Domain) bool

func (*AttributeList) String added in v1.18.8

func (al *AttributeList) String() string

type AttributeMatcher

type AttributeMatcher interface {
	Match(*router.Domain) bool
}

type BooleanMatcher

type BooleanMatcher string

func (BooleanMatcher) Match

func (m BooleanMatcher) Match(domain *router.Domain) bool

type Loader

type Loader interface {
	LoaderImplementation
	LoadGeoSite(list string) ([]*router.Domain, error)
	LoadGeoIP(country string) ([]*router.CIDR, error)
}

func GetGeoDataLoader

func GetGeoDataLoader(name string) (Loader, error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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