From 1e8861abfaa411c408fb458232a25865c88385f3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 02:13:49 +0000 Subject: [PATCH] fix(deps): update module github.com/ip2location/ip2location-go/v9 to v9.7.1 --- go.mod | 4 +- go.sum | 4 + .../ip2location-go/v9/.readthedocs.yaml | 32 ++ .../ip2location/ip2location-go/v9/LICENSE.TXT | 2 +- .../ip2location/ip2location-go/v9/README.md | 498 +----------------- .../ip2location-go/v9/ip2location.go | 312 +++++++---- .../ip2location/ip2location-go/v9/iptools.go | 54 +- vendor/lukechampine.com/uint128/LICENSE | 21 + vendor/lukechampine.com/uint128/README.md | 46 ++ vendor/lukechampine.com/uint128/uint128.go | 440 ++++++++++++++++ vendor/modules.txt | 5 +- 11 files changed, 801 insertions(+), 617 deletions(-) create mode 100644 vendor/github.com/ip2location/ip2location-go/v9/.readthedocs.yaml create mode 100644 vendor/lukechampine.com/uint128/LICENSE create mode 100644 vendor/lukechampine.com/uint128/README.md create mode 100644 vendor/lukechampine.com/uint128/uint128.go diff --git a/go.mod b/go.mod index 695edfb..81968c4 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,6 @@ module github.com/nscuro/traefik-plugin-geoblock go 1.19 -require github.com/ip2location/ip2location-go/v9 v9.5.0 +require github.com/ip2location/ip2location-go/v9 v9.7.1 + +require lukechampine.com/uint128 v1.2.0 // indirect diff --git a/go.sum b/go.sum index 45c3a5b..b677260 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,6 @@ github.com/ip2location/ip2location-go/v9 v9.5.0 h1:7gqKncm4MhBrpJIK0PmV8o6Bf8YbbSAPjORzyjAv1iM= github.com/ip2location/ip2location-go/v9 v9.5.0/go.mod h1:s5SV6YZL10TpfPpXw//7fEJC65G/yH7Oh+Tjq9JcQEQ= +github.com/ip2location/ip2location-go/v9 v9.7.1 h1:eXu/DqS13QE0h1Yrc9oji+6/anLD9KDf6Ulf5GdIQs8= +github.com/ip2location/ip2location-go/v9 v9.7.1/go.mod h1:MPLnsKxwQlvd2lBNcQCsLoyzJLDBFizuO67wXXdzoyI= +lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= diff --git a/vendor/github.com/ip2location/ip2location-go/v9/.readthedocs.yaml b/vendor/github.com/ip2location/ip2location-go/v9/.readthedocs.yaml new file mode 100644 index 0000000..7728509 --- /dev/null +++ b/vendor/github.com/ip2location/ip2location-go/v9/.readthedocs.yaml @@ -0,0 +1,32 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.11" + # You can also specify other tool versions: + # nodejs: "19" + # rust: "1.64" + # golang: "1.19" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/source/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +# formats: +# - pdf +# - epub + +# Optional but recommended, declare the Python requirements required +# to build your documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: docs/requirements.txt \ No newline at end of file diff --git a/vendor/github.com/ip2location/ip2location-go/v9/LICENSE.TXT b/vendor/github.com/ip2location/ip2location-go/v9/LICENSE.TXT index ed5c13b..c96a21a 100644 --- a/vendor/github.com/ip2location/ip2location-go/v9/LICENSE.TXT +++ b/vendor/github.com/ip2location/ip2location-go/v9/LICENSE.TXT @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 IP2Location.com +Copyright (c) 2023 - 2024 IP2Location.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/github.com/ip2location/ip2location-go/v9/README.md b/vendor/github.com/ip2location/ip2location-go/v9/README.md index 6979973..93876e2 100644 --- a/vendor/github.com/ip2location/ip2location-go/v9/README.md +++ b/vendor/github.com/ip2location/ip2location-go/v9/README.md @@ -1,9 +1,9 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/ip2location/ip2location-go/v9)](https://goreportcard.com/report/github.com/ip2location/ip2location-go/v9) - +[![PkgGoDev](https://pkg.go.dev/badge/github.com/ip2location/ip2location-go/v9)](https://pkg.go.dev/github.com/ip2location/ip2location-go/v9) # IP2Location Go Package -This Go package provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, usage type, address type and IAB category from IP address by using IP2Location database. This package uses a file based database available at IP2Location.com. This database simply contains IP blocks as keys, and other information such as country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, usage type, address type and IAB category as values. It supports both IP address in IPv4 and IPv6. +This Go package provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, usage type, address type, IAB category, district, autonomous system number (ASN) and autonomous system (AS) from IP address by using IP2Location database. This package uses a file based database available at IP2Location.com. This database simply contains IP blocks as keys, and other information such as country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, usage type, address type, IAB category, district, autonomous system number (ASN) and autonomous system (AS) as values. It supports both IP address in IPv4 and IPv6. This package can be used in many types of projects such as: @@ -20,497 +20,9 @@ The database will be updated in monthly basis for the greater accuracy. Free LIT The paid databases are available at https://www.ip2location.com under Premium subscription package. As an alternative, this package can also call the IP2Location Web Service. This requires an API key. If you don't have an existing API key, you can subscribe for one at the below: - https://www.ip2location.com/web-service/ip2location -## Installation - -``` -go get github.com/ip2location/ip2location-go/v9 -``` - -## QUERY USING THE BIN FILE - -## Dependencies - -This package requires IP2Location BIN data file to function. You may download the BIN data file at -* IP2Location LITE BIN Data (Free): https://lite.ip2location.com -* IP2Location Commercial BIN Data (Comprehensive): https://www.ip2location.com - - -## IPv4 BIN vs IPv6 BIN - -Use the IPv4 BIN file if you just need to query IPv4 addresses. - -Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses. - - -## Methods - -Below are the methods supported in this package. - -|Method Name|Description| -|---|---| -|OpenDB|Initialize the package with the BIN file.| -|Get_all|Returns the geolocation information in an object.| -|Get_country_short|Returns the country code.| -|Get_country_long|Returns the country name.| -|Get_region|Returns the region name.| -|Get_city|Returns the city name.| -|Get_isp|Returns the ISP name.| -|Get_latitude|Returns the latitude.| -|Get_longitude|Returns the longitude.| -|Get_domain|Returns the domain name.| -|Get_zipcode|Returns the ZIP code.| -|Get_timezone|Returns the time zone.| -|Get_netspeed|Returns the net speed.| -|Get_iddcode|Returns the IDD code.| -|Get_areacode|Returns the area code.| -|Get_weatherstationcode|Returns the weather station code.| -|Get_weatherstationname|Returns the weather station name.| -|Get_mcc|Returns the mobile country code.| -|Get_mnc|Returns the mobile network code.| -|Get_mobilebrand|Returns the mobile brand.| -|Get_elevation|Returns the elevation in meters.| -|Get_usagetype|Returns the usage type.| -|Get_addresstype|Returns the address type.| -|Get_category|Returns the IAB category.| -|Close|Closes BIN file.| - -## Usage - -```go -package main - -import ( - "fmt" - "github.com/ip2location/ip2location-go/v9" -) - -func main() { - db, err := ip2location.OpenDB("./IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE-ADDRESSTYPE-CATEGORY.BIN") - - if err != nil { - fmt.Print(err) - return - } - ip := "8.8.8.8" - results, err := db.Get_all(ip) - - if err != nil { - fmt.Print(err) - return - } - - fmt.Printf("country_short: %s\n", results.Country_short) - fmt.Printf("country_long: %s\n", results.Country_long) - fmt.Printf("region: %s\n", results.Region) - fmt.Printf("city: %s\n", results.City) - fmt.Printf("isp: %s\n", results.Isp) - fmt.Printf("latitude: %f\n", results.Latitude) - fmt.Printf("longitude: %f\n", results.Longitude) - fmt.Printf("domain: %s\n", results.Domain) - fmt.Printf("zipcode: %s\n", results.Zipcode) - fmt.Printf("timezone: %s\n", results.Timezone) - fmt.Printf("netspeed: %s\n", results.Netspeed) - fmt.Printf("iddcode: %s\n", results.Iddcode) - fmt.Printf("areacode: %s\n", results.Areacode) - fmt.Printf("weatherstationcode: %s\n", results.Weatherstationcode) - fmt.Printf("weatherstationname: %s\n", results.Weatherstationname) - fmt.Printf("mcc: %s\n", results.Mcc) - fmt.Printf("mnc: %s\n", results.Mnc) - fmt.Printf("mobilebrand: %s\n", results.Mobilebrand) - fmt.Printf("elevation: %f\n", results.Elevation) - fmt.Printf("usagetype: %s\n", results.Usagetype) - fmt.Printf("addresstype: %s\n", results.Addresstype) - fmt.Printf("category: %s\n", results.Category) - fmt.Printf("api version: %s\n", ip2location.Api_version()) - - db.Close() -} -``` - -## QUERY USING THE IP2LOCATION WEB SERVICE - -## Methods -Below are the methods supported in this package. - -|Method Name|Description| -|---|---| -|OpenWS| 3 input parameters:
  1. IP2Location API Key.
  2. Package (WS1 - WS25)
  3. Use HTTPS or HTTP
| -|LookUp|Query IP address. This method returns an object containing the geolocation info.