geo

package
v0.0.0-...-e528a46 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATA_DIR       = "data/geoip"
	DB_NAME        = "GeoLite2-City.mmdb"
	EDITION        = "GeoLite2-City"
	DBREFRESH      = "24h"
	VERBOSE_UPDATE = false
	LICENSE_KEY    = "testing"
	ACCOUNT_ID     = 123
)
View Source
const (
	SERVICE_NAME      = "GeoService"
	BLOCK_MEASUREMENT = "ip_block"
	TIME_LAYOUT       = "Jul 13 15:20:54"
)

Variables

This section is empty.

Functions

func NewGeoHandler

func NewGeoHandler(ctx context.Context, tokenAuth *jwtauth.JWTAuth) models.HandlerIFace

func NewGeoIPService

func NewGeoIPService(ctx context.Context) (geoService models.Service)

func String

func String() string

Types

type GeoHandler

type GeoHandler struct {
	models.Handler
	// contains filtered or unexported fields
}

func (GeoHandler) GetPrefix

func (gh GeoHandler) GetPrefix() string

func (GeoHandler) GetRoutes

func (gh GeoHandler) GetRoutes() []models.Route

func (GeoHandler) GetService

func (gh GeoHandler) GetService() models.Service

type GeoIPService

type GeoIPService struct {
	Config *GeoIpConfig

	Updater        *update.GeoIpUpdater
	InfluxDbWriter *influxwriter.InfluxDbWriter
	// contains filtered or unexported fields
}

func (GeoIPService) GetName

func (gs GeoIPService) GetName() (name string)

type GeoIpConfig

type GeoIpConfig struct {
	AccountId         int
	DatabaseDirectory string
	DatabaseName      string
	EditionIDs        []string
	LicenseKey        string
	RefreshDuration   time.Duration
	VerboseUpdate     bool
}

func InitGeoIpConfig

func InitGeoIpConfig() (config *GeoIpConfig, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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