Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PreProcessFieldAlias = map[string]string{
"location_accuracy_radius": "accuracy_radius",
"location_latitude": "latitude",
"location_longitude": "longitude",
"location_metro_code": "metro_code",
"location_time_zone": "time_zone",
"traits_autonomous_system_number": "autonomous_system_number",
"traits_autonomous_system_organization": "autonomous_system_organization",
"traits_connection_type": "connection_type",
"traits_domain": "domain",
"traits_is_anonymous_proxy": "is_anonymous_proxy",
"traits_is_legitimate_proxy": "is_legitimate_proxy",
"traits_is_satellite_provider": "is_satellite_provider",
"traits_isp": "isp",
"traits_mobile_country_code": "mobile_country_code",
"traits_mobile_network_code": "mobile_network_code",
"traits_organization": "organization",
"traits_static_ip_score": "static_ip_score",
"traits_user_type": "user_type",
"continent_name": "continent",
"country_name": "country",
"asn": "autonomous_system_number",
"as_name": "autonomous_system_organization",
"as_domain": "domain",
}
PreProcessFieldAlias maps fields from various sources to a standardized format. This is useful for normalizing field names from different IP information providers.
Functions ¶
func ConvertMapToFields ¶
ConvertMapToFields converts a map of data from MMDB into a map of strings, optionally using full fields (combining all data into a JSON string).
func DoPreProcessFieldAlias ¶
DoPreProcessFieldAlias takes a map of data fields and standardizes their names using the PreProcessFieldAlias mapping. This helps ensure consistency in field names regardless of the data source.
func ParseReflectValue ¶
func ParseReflectValue(value interface{}) (interface{}, error)
ParseReflectValue processes an interface value and returns its converted string or map representation.
Types ¶
type Reader ¶
type Reader struct { IPVersion int // IP versions supported by the database (IPv4, IPv6, or both) Fields []string // Fields present in the database DisableExtraData bool // Whether to disable the use of extra data matched by GeoNameID UseFullField bool // Whether to use full field. If enabled, all data is combined into a single field as a JSON string. // contains filtered or unexported fields }
Reader wraps the maxminddb Reader and provides additional functionalities for reading and parsing IP related data.