110a11828b
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
16 lines
295 B
Go
16 lines
295 B
Go
package geolocate
|
|
|
|
import (
|
|
"github.com/ooni/probe-cli/v3/internal/geoipx"
|
|
)
|
|
|
|
type mmdbLookupper struct{}
|
|
|
|
func (mmdbLookupper) LookupASN(ip string) (uint, string, error) {
|
|
return geoipx.LookupASN(ip)
|
|
}
|
|
|
|
func (mmdbLookupper) LookupCC(ip string) (string, error) {
|
|
return geoipx.LookupCC(ip)
|
|
}
|