mod_geo

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

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