IpGeolocation

marola.location.IpGeolocation
object IpGeolocation

Coarse "where am I" for the CLI, from the machine's public IP — the zero-setup fallback when neither --lat/--lon nor MAROLA_ORIGIN_LAT/LON is given (see Main.resolveOrigin).

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class Provider(name: String, url: String, parse: JsonValue => Option[(Coordinates, Option[String])])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def consensus(candidates: List[(String, Coordinates, Option[String])]): Option[IpLocation]

Pure vote over whatever answered: the medoid (smallest summed distance to every other answer) wins, and every answer within AgreementRadiusKm of it is counted as agreeing.

Pure vote over whatever answered: the medoid (smallest summed distance to every other answer) wins, and every answer within AgreementRadiusKm of it is counted as agreeing.

Attributes

def locate: Option[IpLocation] < Sync

None only when no provider answered usably (offline, all rate-limited, ...).

None only when no provider answered usably (offline, all rate-limited, ...).

Attributes

Concrete fields

val AgreementRadiusKm: Double

Answers within this distance of the medoid count as agreeing with it.

Answers within this distance of the medoid count as agreeing with it.

Attributes

val Providers: List[Provider]