Documentation ¶
Index ¶
- Constants
- Variables
- func DetectEndian() (binary.ByteOrder, error)
- func Endian() string
- func ReadDBToMemory(path string) (bool, error)
- func Seek(ip string) (uint32, error)
- func SetEndian(order bool)
- func ToMemory(f *bytes.Reader) (bool, error)
- type City
- type Country
- type Full
- type Header
- type Info
- type Meta
- type Region
Constants ¶
View Source
const ( PACKTYPECOUNTRY = 0 PACKTYPEREGION = 1 PACKTYPECITY = 2 )
View Source
const BIG = false
View Source
const LITTLE = true
Variables ¶
View Source
var ( DB []byte Regions []byte Cities []byte )
Functions ¶
func DetectEndian ¶
func ReadDBToMemory ¶
ReadDBToMemory Reads the whole DB to the memory
Types ¶
type Full ¶
type Full struct { City *City `json:"city"` Country *Country `json:"country"` Region *Region `json:"region"` }
func GetCityFull ¶
type Info ¶
type Info struct { Ver byte // C Time uint32 // N Type byte Charset byte BIdxLen byte MIdxLen uint16 // n Range uint16 DbItems uint32 IdLen byte MaxRegion uint16 MaxCity uint16 RegionSize uint32 CitySize uint32 MaxCountry uint16 CountrySize uint32 PackSize uint16 }
var I Info
Click to show internal directories.
Click to hide internal directories.