geodata

package
v1.19.34-clash.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: GPL-3.0 Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MaxMMDBBytes    int64 = 64 << 20
	MaxDatFileBytes int64 = 128 << 20
)

Variables

This section is empty.

Functions

func ASNEnable

func ASNEnable() bool

func ASNUrl

func ASNUrl() string

func ClearGeoIPCache

func ClearGeoIPCache()

func ClearGeoSiteCache

func ClearGeoSiteCache()

func CompileGeoIP

func CompileGeoIP(country string) error

func CompileGeoSite

func CompileGeoSite(category string) error

func CompiledGeoIPDir

func CompiledGeoIPDir() string

func CompiledGeoIPOnly

func CompiledGeoIPOnly() bool

func CompiledGeoSiteDir

func CompiledGeoSiteDir() string

func CompiledGeoSiteKey

func CompiledGeoSiteKey(category string) (string, error)

func CompiledGeoSiteOnly

func CompiledGeoSiteOnly() bool

func CountGeoIP

func CountGeoIP(country string) (int, error)

func CountGeoSite

func CountGeoSite(category string) (int, error)

func GeoIpEnable

func GeoIpEnable() bool

func GeoIpUrl

func GeoIpUrl() string

func GeoSiteEnable

func GeoSiteEnable() bool

func GeoSiteUrl

func GeoSiteUrl() string

func GeodataMode

func GeodataMode() bool

func GeodataProgressReporter

func GeodataProgressReporter() func(string)

func InitASN

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 MarkGeoSiteVerified

func MarkGeoSiteVerified()

func MmdbUrl

func MmdbUrl() string

func RegisterGeoDataLoaderImplementationCreator

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

func SetASNUrl

func SetASNUrl(url string)

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 SetLoader

func SetLoader(newLoader string)

func SetMmdbUrl

func SetMmdbUrl(url string)

func SetSiteMatcher

func SetSiteMatcher(newMatcher string)

func SiteMatcherName

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

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