go-sypexgeo.v1: gopkg.in/mirrr/go-sypexgeo.v1 Index | Files | Directories

package sypexgeo

import "gopkg.in/mirrr/go-sypexgeo.v1"

Package sypexgeo to access data from Sypex Geo IP database files, accepts only SypexGeo 2.2 databases


Package Files

countries.go sypex.go utils.go

type City Uses

type City struct {
    ID     uint32
    NameEn string
    NameRu string
    Lon    float32
    Lat    float32

City struct

type Country Uses

type Country struct {
    ID     uint8
    ISO    string
    NameEn string
    NameRu string
    Lon    float32
    Lat    float32

Country struct

type Region Uses

type Region struct {
    ID     uint32
    ISO    string
    NameEn string
    NameRu string

Region struct

type Result Uses

type Result struct {
    Country Country
    Region  Region
    City    City

Result of geoip lookup

type SxGEO Uses

type SxGEO struct {
    Version float32
    Updated uint32
    // contains filtered or unexported fields

SxGEO main object

func New Uses

func New(filename string) SxGEO

New SxGEO object

func (*SxGEO) City Uses

func (s *SxGEO) City(IP string) (City, error)

City info by IP

func (*SxGEO) Country Uses

func (s *SxGEO) Country(IP string) (Country, error)

Country info by IP

func (*SxGEO) GetCity Uses

func (s *SxGEO) GetCity(IP string) (map[string]interface{}, error)

GetCity get short info by IP

func (*SxGEO) GetCityFull Uses

func (s *SxGEO) GetCityFull(IP string) (map[string]interface{}, error)

GetCityFull get full info by IP (with regions and countries data)

func (*SxGEO) GetCountry Uses

func (s *SxGEO) GetCountry(IP string) (string, error)

GetCountry return string country iso-code, like `RU`, `UA` etc.

func (*SxGEO) GetCountryID Uses

func (s *SxGEO) GetCountryID(IP string) (int, error)

GetCountryID return integer country identifier

func (*SxGEO) Info Uses

func (s *SxGEO) Info(IP string) (Result, error)

Info by IP



Package sypexgeo imports 6 packages (graph). Updated 2019-08-27. Refresh now. Tools for package owners.