config

package
v0.0.0-...-b6cbe2a Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// UseSentry whether ipd server use sentry or not
	UseSentry bool = true
	// SentryDSN sentry DSN
	SentryDSN string = "https://3d94eafaf06c4626aa6fec57a5e78176:4d1da97ba2e14289b34d0aa5e09ef49b@sentry.io/1200974"
	// Port ipd server port
	Port string = "6789"
	// IPChanelBuf chanel buffer size for FindIP go routine
	IPChanelBuf int = 200
	// AuthKey used for authorization, should not be changed
	AuthKey string = "thisisaveryimportantkey"
	// APITimeOut ip api timeout
	APITimeOut time.Duration = time.Duration(3) * time.Second
	// BaiDuAK baidu ak key
	BaiDuAK string = "dXkvR03fdzCvUvfb69Ztnlr6UBMk7Azy"
	// BaiDuReferer baidu api referer
	BaiDuReferer string = "www.mygoipapi.com"
	// RequestOrder request order
	RequestOrder []string = []string{"ip2region", "chunzhen", "geolite2", "api"}
	// IP2RegionURL url to download ip2region.db file
	IP2RegionURL string = "https://github.com/lionsoul2014/ip2region/raw/master/data/ip2region.db"
	// Expiration cache expiration time
	Expiration time.Duration = time.Duration(10) * time.Minute
	// MaxEntry max entry size
	MaxEntry int = 1000
	// bigcache cache client
	Cache *bigcache.BigCache
	// StoreES store ip information in elasticsearch or not
	StoreES bool = true
	// ESURL elasticsearch url
	ESURL string = "http://127.0.0.1:9200"
	// ESIndex elasticsearch index used to store the ip information
	ESIndex string = "ipinfo"
	//ESMapping ipinfo mapping
	ESMapping string = `` /* 578-byte string literal not displayed */

)
View Source
var GeoMap = map[string]Geo{}/* 219 elements not displayed */

GeoMap geo map

Functions

This section is empty.

Types

type Geo

type Geo struct {
	GeoX float64 `json:"geo_x"`
	GeoY float64 `json:"geo_y"`
}

Geo geo struct

type IP

type IP struct {
	IP []string `json:"ip"`
}

IP ip struct

type IPInfo

type IPInfo struct {
	IP      string `json:"ip"`
	Country string `json:"country"`
	Region  string `json:"region"`
	City    string `json:"city"`
	ISP     string `json:"isp"`
}

IPInfo ipinfo struct

type IPWithGeo

type IPWithGeo struct {
	IPInfo
	Geo
}

IPWithGeo combine IPInfo and Geo

Jump to

Keyboard shortcuts

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