geo

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoLoader

type GeoLoader interface {
	LoadGeoIP() (map[string]*v2geo.GeoIP, error)
	LoadGeoSite() (map[string]*v2geo.GeoSite, error)
}

type GeoMatcher

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

func NewGeoMatcher

func NewGeoMatcher(geoSiteFilename, geoIpFilename string) *GeoMatcher

func (*GeoMatcher) LoadGeoIP

func (g *GeoMatcher) LoadGeoIP() error

func (*GeoMatcher) LoadGeoSite

func (g *GeoMatcher) LoadGeoSite() error

func (*GeoMatcher) MatchGeoIp

func (g *GeoMatcher) MatchGeoIp(ip, condition string) bool

func (*GeoMatcher) MatchGeoSite

func (g *GeoMatcher) MatchGeoSite(site, condition string) bool

type HostInfo

type HostInfo struct {
	Name string
	IPv4 net.IP
	IPv6 net.IP
}

func (HostInfo) String

func (h HostInfo) String() string

type V2GeoLoader

type V2GeoLoader struct {
	GeoIPFilename   string
	GeoSiteFilename string
	UpdateInterval  time.Duration

	DownloadFunc    func(filename, url string)
	DownloadErrFunc func(err error)
	// contains filtered or unexported fields
}

V2GeoLoader provides the on-demand GeoIP/MatchGeoSite database loading functionality required by the ACL engine. Empty filenames = automatic download from built-in URLs.

func NewDefaultGeoLoader

func NewDefaultGeoLoader(geoSiteFilename, geoIpFilename string) *V2GeoLoader

func (*V2GeoLoader) LoadGeoIP

func (l *V2GeoLoader) LoadGeoIP() (map[string]*v2geo.GeoIP, error)

func (*V2GeoLoader) LoadGeoSite

func (l *V2GeoLoader) LoadGeoSite() (map[string]*v2geo.GeoSite, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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