refactor: spin geoipx off geolocate (#893)
A bunch of packages (including oohelperd) just need the ability to use MaxMind-like databases. They don't need the additional functionality implemented by the geolocate package. Such a package, in fact, is mostly (if not only) needed by the engine package. Therefore, move code to query MaxMind-like databases to a separate package, and avoid depending on geolocate in all the packages for which it's sufficient to use geoipx. Part of https://github.com/ooni/probe/issues/2240
This commit is contained in:
parent
1e7384d1cc
commit
110a11828b
23 changed files with 224 additions and 211 deletions
|
|
@ -11,7 +11,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/experiment/webconnectivity"
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/geolocate"
|
||||
"github.com/ooni/probe-cli/v3/internal/geoipx"
|
||||
"github.com/ooni/probe-cli/v3/internal/netxlite"
|
||||
)
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ func newIPInfo(creq *ctrlRequest, addrs []string) map[string]*webconnectivity.Co
|
|||
if netxlite.IsBogon(addr) { // note: we already excluded non-IP addrs above
|
||||
flags |= webconnectivity.ControlIPInfoFlagIsBogon
|
||||
}
|
||||
asn, _, _ := geolocate.LookupASN(addr) // AS0 on failure
|
||||
asn, _, _ := geoipx.LookupASN(addr) // AS0 on failure
|
||||
ipinfo[addr] = &webconnectivity.ControlIPInfo{
|
||||
ASN: int64(asn),
|
||||
Flags: flags,
|
||||
|
|
|
|||
Loading…
Reference in a new issue