geo

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

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Package geo provides geolocation functions.

Index

Constants

View Source
const (
	// DefaultCacheSize determines the default size for the ip cache
	DefaultCacheSize = 100000
)

Variables

This section is empty.

Functions

func CITY

func CITY(ip goexpr.Expr) goexpr.Expr

CITY returns the city name for the IP, e.g. "Austin"

func COUNTRY_CODE

func COUNTRY_CODE(ip goexpr.Expr) goexpr.Expr

COUNTRY_CODE returns the 2 digit ISO country code for the ip, e.g. "US"

func Init

func Init(dbFile string, cacheSize int) error

Init initializes the Geolocation subsystem, storing the database file at the given dbFile location. It will periodically fetch updates from the maxmind website.

func REGION

func REGION(ip goexpr.Expr) goexpr.Expr

REGION returns the region name for the IP, e.g. "Texas"

func REGION_CITY

func REGION_CITY(ip goexpr.Expr) goexpr.Expr

REGION_CITY returns the region and city name for the IP, e.g. "Texas, Austin"

Types

This section is empty.

Jump to

Keyboard shortcuts

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