mod_geo

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 13 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 (
	ModGeo = "mod_geo"

	GeoDBDefaultPath = "mod_geo/geo.db"
)

Variables

View Source
var (
	CtxCountryIsoCode     = "mod_geo.country_iso_code"
	CtxSubdivisionIsoCode = "mod_geo.subdivision_iso_code"
	CtxCityName           = "mod_geo.city_name"
	CtxLatitude           = "mod_geo.latitude"
	CtxLongitude          = "mod_geo.longitude"
)

Functions

func ConfModBlockCheck

func ConfModBlockCheck(cfg *ConfModGeo, confRoot string) error

Types

type ConfModGeo

type ConfModGeo struct {
	Basic struct {
		GeoDBPath string // path of geolocation database
	}

	Log struct {
		OpenDebug bool
	}
}

func ConfLoad

func ConfLoad(filePath string, confRoot string) (*ConfModGeo, error)

ConfLoad loads config of geo module from file.

func (*ConfModGeo) Check

func (cfg *ConfModGeo) Check(confRoot string) error

Check validates module config

type ModuleGeo

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

func NewModuleGeo

func NewModuleGeo() *ModuleGeo

func (*ModuleGeo) Init

func (*ModuleGeo) Name

func (m *ModuleGeo) Name() string

type ModuleGeoIdState

type ModuleGeoIdState struct {
	ErrReloadGeoDatabase *metrics.Counter // counter for reload geolocation database
	ErrGetGeoInfo        *metrics.Counter // counter for get geolocation information
}

Jump to

Keyboard shortcuts

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