geodata

package
v0.0.0-...-4d950b6 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AutoUpdate     bool
	UpdateInterval int
)

Functions

func ClearCache

func ClearCache()

func GeoAutoUpdate

func GeoAutoUpdate() bool

func GeoUpdateInterval

func GeoUpdateInterval() int

func GeodataMode

func GeodataMode() bool

func InitASN

func InitASN() error

func InitGeoIP

func InitGeoIP() error

func InitGeoSite

func InitGeoSite() error

func LoadGeoIPMatcher

func LoadGeoIPMatcher(country string) (*router.GeoIPMatcher, int, error)

func LoadGeoSiteMatcher

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

func LoaderName

func LoaderName() string

func RegisterGeoDataLoaderImplementationCreator

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

func SetGeoAutoUpdate

func SetGeoAutoUpdate(newAutoUpdate bool)

func SetGeoUpdateInterval

func SetGeoUpdateInterval(newGeoUpdateInterval int)

func SetGeodataMode

func SetGeodataMode(newGeodataMode bool)

func SetLoader

func SetLoader(newLoader 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

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