entity

package
v0.0.0-...-5f57c41 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type City

type City struct {
	City struct {
		GeoNameID uint              `maxminddb:"geoname_id" json:"geoNameID,omitempty"`
		Names     map[string]string `maxminddb:"names" json:"names,omitempty"`
	} `maxminddb:"city" json:"city,omitempty"`
	Continent struct {
		Code      string            `maxminddb:"code" json:"code,omitempty"`
		GeoNameID uint              `maxminddb:"geoname_id" json:"geoNameID,omitempty"`
		Names     map[string]string `maxminddb:"names" json:"names,omitempty"`
	} `maxminddb:"continent" json:"continent,omitempty"`
	Country struct {
		GeoNameID         uint              `maxminddb:"geoname_id" json:"geoNameID,omitempty"`
		IsInEuropeanUnion bool              `maxminddb:"is_in_european_union" json:"isInEuropeanUnion,omitempty"`
		IsoCode           string            `maxminddb:"iso_code" json:"isoCode,omitempty"`
		Names             map[string]string `maxminddb:"names" json:"names,omitempty"`
	} `maxminddb:"country" json:"country,omitempty"`
	Location struct {
		AccuracyRadius uint16  `maxminddb:"accuracy_radius" json:"accuracyRadius,omitempty"`
		Latitude       float64 `maxminddb:"latitude" json:"latitude,omitempty"`
		Longitude      float64 `maxminddb:"longitude" json:"longitude,omitempty"`
		MetroCode      uint    `maxminddb:"metro_code" json:"metroCode,omitempty"`
		TimeZone       string  `maxminddb:"time_zone" json:"timeZone,omitempty"`
	} `maxminddb:"location" json:"location,omitempty"`
	Postal struct {
		Code string `maxminddb:"code" json:"code,omitempty"`
	} `maxminddb:"postal" json:"postal,omitempty"`
	RegisteredCountry struct {
		GeoNameID         uint              `maxminddb:"geoname_id" json:"geoNameID,omitempty"`
		IsInEuropeanUnion bool              `maxminddb:"is_in_european_union" json:"isInEuropeanUnion,omitempty"`
		IsoCode           string            `maxminddb:"iso_code" json:"isoCode,omitempty"`
		Names             map[string]string `maxminddb:"names" json:"names,omitempty"`
	} `maxminddb:"registered_country" json:"registeredCountry,omitempty"`
	RepresentedCountry struct {
		GeoNameID         uint              `maxminddb:"geoname_id" json:"geoNameID,omitempty"`
		IsInEuropeanUnion bool              `maxminddb:"is_in_european_union" json:"isInEuropeanUnion,omitempty"`
		IsoCode           string            `maxminddb:"iso_code" json:"isoCode,omitempty"`
		Names             map[string]string `maxminddb:"names" json:"names,omitempty"`
		Type              string            `maxminddb:"type" json:"type,omitempty"`
	} `maxminddb:"represented_country" json:"representedCountry,omitempty"`
	Subdivisions []struct {
		GeoNameID uint              `maxminddb:"geoname_id" json:"geoNameID,omitempty"`
		IsoCode   string            `maxminddb:"iso_code" json:"isoCode,omitempty"`
		Names     map[string]string `maxminddb:"names" json:"names,omitempty"`
	} `maxminddb:"subdivisions" json:"subdivisions,omitempty"`
	Traits struct {
		IsAnonymousProxy    bool `maxminddb:"is_anonymous_proxy" json:"isAnonymousProxy,omitempty"`
		IsSatelliteProvider bool `maxminddb:"is_satellite_provider" json:"isSatelliteProvider,omitempty"`
	} `maxminddb:"traits" json:"traits,omitempty"`

	ISP *ISP `json:"ISP,omitempty"`
}
var PrivateCity City

func (City) MarshalCSV

func (record City) MarshalCSV() (names, row []string, err error)

func (City) ToMMDBType

func (city City) ToMMDBType() mmdbtype.Map

type CityLite

type CityLite struct {
	City struct {
		Name string `json:"name,omitempty"`
	} `json:"city,omitempty"`
	Country struct {
		ISOCode string `json:"isoCode,omitempty"`
		Name    string `json:"name,omitempty"`
	} `json:"country,omitempty"`
	Location LocationLite `json:"location,omitempty"`
}

func DbToCityLite

func DbToCityLite(cityLiteDb *CityLiteDb, lang string) *CityLite

type CityLiteDb

type CityLiteDb struct {
	City struct {
		Names map[string]string `maxminddb:"names" json:"names,omitempty"`
	} `maxminddb:"city" json:"city,omitempty"`
	Country struct {
		ISOCode string            `maxminddb:"iso_code" json:"isoCode,omitempty"`
		Names   map[string]string `maxminddb:"names" json:"names,omitempty"`
	} `maxminddb:"country" json:"country,omitempty"`
	Location LocationLite `maxminddb:"location" json:"location,omitempty"`
}

type Country

type Country struct {
	Continent struct {
		Code      string            `maxminddb:"code" json:"code,omitempty"`
		GeoNameID uint              `maxminddb:"geoname_id" json:"geoNameID,omitempty"`
		Names     map[string]string `maxminddb:"names" json:"names,omitempty"`
	} `maxminddb:"continent" json:"continent,omitempty"`
	Country struct {
		GeoNameID         uint              `maxminddb:"geoname_id" json:"geoNameID,omitempty"`
		IsInEuropeanUnion bool              `maxminddb:"is_in_european_union" json:"isInEuropeanUnion,omitempty"`
		IsoCode           string            `maxminddb:"iso_code" json:"isoCode,omitempty"`
		Names             map[string]string `maxminddb:"names" json:"names,omitempty"`
	} `maxminddb:"country" json:"country,omitempty"`
	RegisteredCountry struct {
		GeoNameID         uint              `maxminddb:"geoname_id" json:"geoNameID,omitempty"`
		IsInEuropeanUnion bool              `maxminddb:"is_in_european_union" json:"isInEuropeanUnion,omitempty"`
		IsoCode           string            `maxminddb:"iso_code" json:"isoCode,omitempty"`
		Names             map[string]string `maxminddb:"names" json:"names,omitempty"`
	} `maxminddb:"registered_country" json:"registeredCountry,omitempty"`
	RepresentedCountry struct {
		GeoNameID         uint              `maxminddb:"geoname_id" json:"geoNameID,omitempty"`
		IsInEuropeanUnion bool              `maxminddb:"is_in_european_union" json:"isInEuropeanUnion,omitempty"`
		IsoCode           string            `maxminddb:"iso_code" json:"isoCode,omitempty"`
		Names             map[string]string `maxminddb:"names" json:"names,omitempty"`
		Type              string            `maxminddb:"type" json:"type,omitempty"`
	} `maxminddb:"represented_country" json:"representedCountry,omitempty"`
	Traits struct {
		IsAnonymousProxy    bool `maxminddb:"is_anonymous_proxy" json:"isAnonymousProxy,omitempty"`
		IsSatelliteProvider bool `maxminddb:"is_satellite_provider" json:"isSatelliteProvider,omitempty"`
	} `maxminddb:"traits" json:"traits,omitempty"`
}

type Database

type Database struct {
	Data io.Reader
	MetaData
	Ext string
}

func (*Database) FileName

func (db *Database) FileName() string

type GeoName

type GeoName struct {
	*models.Geoname
}

func (GeoName) CountryCode

func (g GeoName) CountryCode() string

func (GeoName) GeoNameID

func (g GeoName) GeoNameID() int

func (GeoName) MarshalJSON

func (s GeoName) MarshalJSON() ([]byte, error)

func (GeoName) Name

func (g GeoName) Name() string

func (*GeoName) UnmarshalJSON

func (s *GeoName) UnmarshalJSON(data []byte) error

type GeoNameAdminSubdivision

type GeoNameAdminSubdivision struct {
	*models.AdminDivision
}

func (GeoNameAdminSubdivision) AdminCode

func (s GeoNameAdminSubdivision) AdminCode() string

func (GeoNameAdminSubdivision) CountryCode

func (s GeoNameAdminSubdivision) CountryCode() string

func (GeoNameAdminSubdivision) GeoNameID

func (s GeoNameAdminSubdivision) GeoNameID() int

func (GeoNameAdminSubdivision) MarshalJSON

func (s GeoNameAdminSubdivision) MarshalJSON() ([]byte, error)

func (GeoNameAdminSubdivision) Name

func (*GeoNameAdminSubdivision) UnmarshalJSON

func (s *GeoNameAdminSubdivision) UnmarshalJSON(data []byte) error

type GeoNameContinent

type GeoNameContinent struct {
	// contains filtered or unexported fields
}

func NewGeoNameContinent

func NewGeoNameContinent(geonameID int, code, name string) *GeoNameContinent

func (GeoNameContinent) Code

func (c GeoNameContinent) Code() string

func (GeoNameContinent) CountryCode

func (c GeoNameContinent) CountryCode() string

func (GeoNameContinent) GeoNameID

func (c GeoNameContinent) GeoNameID() int

func (GeoNameContinent) MarshalJSON

func (s GeoNameContinent) MarshalJSON() ([]byte, error)

func (GeoNameContinent) Name

func (c GeoNameContinent) Name() string

func (*GeoNameContinent) UnmarshalJSON

func (s *GeoNameContinent) UnmarshalJSON(data []byte) error

type GeoNameCountry

type GeoNameCountry struct {
	*models.Country
}

func (GeoNameCountry) CountryCode

func (s GeoNameCountry) CountryCode() string

func (GeoNameCountry) GeoNameID

func (s GeoNameCountry) GeoNameID() int

func (GeoNameCountry) MarshalJSON

func (s GeoNameCountry) MarshalJSON() ([]byte, error)

func (GeoNameCountry) Name

func (s GeoNameCountry) Name() string

func (*GeoNameCountry) UnmarshalJSON

func (s *GeoNameCountry) UnmarshalJSON(data []byte) error

type GeoNameEntity

type GeoNameEntity interface {
	GeoNameID() int
	Name() string
	CountryCode() string
}

type GeoNameFilter

type GeoNameFilter struct {
	GeoNameIDs   []uint32 `schema:"geoname-ids"`
	CountryCodes []string `schema:"country-codes"`
	NamePrefix   string   `schema:"name-prefix"`
	Limit        uint32   `schema:"limit"`
}

func (*GeoNameFilter) Match

func (f *GeoNameFilter) Match(e GeoNameEntity) bool

type ISP

type ISP struct {
	AutonomousSystemOrganization string `maxminddb:"autonomous_system_organization"`
	ISP                          string `maxminddb:"isp"`
	MobileCountryCode            string `maxminddb:"mobile_country_code"`
	MobileNetworkCode            string `maxminddb:"mobile_network_code"`
	Organization                 string `maxminddb:"organization"`
	AutonomousSystemNumber       uint   `maxminddb:"autonomous_system_number"`
}

The ISP struct corresponds to the data in the GeoIP2 ISP database.

func (ISP) MarshalCSV

func (record ISP) MarshalCSV() (names, row []string, err error)

type LocationLite

type LocationLite struct {
	Latitude  float64 `maxminddb:"latitude" json:"latitude,omitempty"`
	Longitude float64 `maxminddb:"longitude" json:"longitude,omitempty"`
	TimeZone  string  `maxminddb:"time_zone" json:"timeZone,omitempty"`
}

type MetaData

type MetaData = maxminddb.Metadata

Jump to

Keyboard shortcuts

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