All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
More infos about this file : http://keepachangelog.com/
- Update dependencies.
- The cache key is now generated from a given function, as input of
DistanceApi
.
- Fix for
GoogleDistanceProvider
: stop adding the traffic duration to the default duration: consider it as a full travel duration value and not only the in-traffic offset. - Update dependencies:
- Monix 3.1.0
- Squants 1.5.0
- scalafmt-core 2.2.2
- scalacheck 1.14.2
- Fix for
Google Geoprovider
: usingaddress
parameter instead ofcomponents
for postal code geocoding to succeed in some not working cases. - Update minor dependencies.
- Fix: the no-cache module was throwing an exception on methods besides
cachingF
.
- Fix: cache was not read any more on single distance calls.
- Update dependencies
- cats 2.0.0 : Bring breaking changes. Please refer to the cats' documentation
- cats-effect 2.0.0
- circe 0.12.1
- circe-optics 0.12.0
- monix 3.0.0 : Used only in tests
- Add
Cache
methods:caching
: likecachingF
but with an input valueV
instead of a wrapped valueF[V]
.get
: retrieve the value wrapped as aF[Option[V]]
.remove
: remove a key from the cache, returnsF[Unit]
. Used in the tests only.removeAll
: remove all keys from the cache, returnsF[Unit]
. Was used before in the tests, but is replaced now withremoved
.
DistanceApi
now returnsMap
s of valuesEither[E, Distance]
(previouslyDistance
) to embed errors related to the distance computation (e.g. no route available). The error type has to be specified and is related to the distance provider. It also supports batched calls for distances (taking as input multiple origins and destinations), and tries to make as few calls as possible, depending on the already cached values. This involves the following changes:- Add arguments to
DistanceApi
Caching[F, Distance]
which is an alias for(Distance, Decoder[Distance], Encoder[Distance], Any*) => F[Distance]
.GetCached[F, Distance]
which is an alias for(Decoder[Distance], Any*) => F[Option[Distance]]
.
- Remove
CachingF[F, Distance]
argument fromDistanceApi
. - Add type parameter to
DistanceApi
: it is nowDistanceApi[F[_]: Async: Par, E]
. - Add
batchDistances
method toDistanceApi
andGoogleDistanceProvider
. - Add Google error type
GoogleDistanceProviderError
(plus implementations).GoogleDistanceProvider
now extends asDistanceProvider[F, GoogleDistanceProviderError]
.
- Add arguments to
- Add a function to
GoogleGeoApiContext
to handle logging of HTTP calls from Google Maps withOkHttpLoggingInterceptor
. - Complete the Google traffic estimation models with optimistic and pessimistic models. Modify the
maybeDepartureTime
argument to aOption[TrafficHandling]
which is composed of the departure time (Instant
) and of the traffic model (TrafficModel
), everywheremaybeDepartureTime
was used. - Add
.asGoogle
helper method to convertscala-distances
types (LatLong
,TrafficModel
,TravelMode
) to Google types. - Update some dependencies (notably
cats-effect
1.4.0,google-maps-services
0.9.4).
- Fix on the Google Maps response when the
departureTime
argument was specified: the API response was not properly taken into account.
DistanceApi
now takes an optional argumentdepartureTime
which specifies when the vehicle will commit the travel. This is argument is transmitted to Google Maps API to retrieve the time passed in traffic, if specified and available. Warning: specifying this argument results in a API call cost doubled, at the time of writing.
- Rename package to
com.colisweb.distances
. DistanceApi[F]
now takes as inputs distance and caching functions instead of provider instances.
- Update dependencies (cats-effect 1.3.0, circe 0.11.0)
(versions v1.0.0-RC[3,4,5] are corrupted. Do not use them)
- Modularize the lib
The lib is now composed of 3 parts:
- the
core
- the
providers
- the
caches
Providers
have 2 roles:
- Compute distances between Gps points
- Geocode addresses
A prodider
implementation can choose to implement only one of these 2 concers.
Fow now, we propose only one provider
implementation, based on Google APIs, which addresses the 2 concerns.
We propose 3 cache
implementations:
- One "distributed" cache, based on Redis
- One in memory cache, based on Caffeine
- One which doesn't cache anything.
- Google API calls should be cancelable
- Improve
GoogleDistanceProvider
code, error handling and error reporting - Improve
GoogleGeoProvider
code, error handling and error reporting - Update dependencies (Monix 3.0.0-RC2, Cats 1.4.0, Cats-Effect 1.0.0)
- Replace
sbt-release-early
bysbt-release
- Fix english naming:
Ambigue
->Ambiguous
- DistanceApi#distances method should also accept
Array
s - Some small optimisations
- New API
- The API is now generalized for any effect system that implements the
cats-effect
Async
andParallel
typeclasses
- Use
sbt-tpolecat
plugin instead of our manually defined scalac options - Change used scalafmt plugin
- Update Scala 2.12 version
- Update Scala 2.12 version
- Update dependencies
- Improve how
GoogleGeocoder.geocodeNonAmbigueAddressT
retrieves geocoding
WARNING: Read the method documentation before using it !
- Add tests for
GoogleGeocoder.geocodeNonAmbigueAddressT
- [HOTFIX] The new Distance API implementation was bugged
- Add some tests for the Distance API
- Use the
global
monix Scheduler instead of our own badly crafted one - Update libs
- Add the possibility to geocode non ambigue addresses
- Handle travel modes
- Distance ordering should not be hard coded
- Small optimisation: Do not call the geocoder if origin == destination
- Simplify types thanks to type aliases
- Small optimization: Small optimization: if origin == destination, immediately return a distance to 0
- Small optimisation: Call the geocoder only once if origin == destination
- FIX: Distances should be compared by their durations and not by their lenghts
- Improve
scalacOptions
config - Update dependencies
- Add the possibility to tune the database used in Redis without any password
- Add the possibility to tune the database used in Redis
- Simplify the use of the library
- Add the possibility to use a Redis protected by password
- Add the possibility to tune the connection and the read timeouts of the Google Geo API client
- Try fix build
- Try fix build by adding scmInfo
- Try fix build
- Configure Codecov
- Configure
sbt-release-early
, Travis and Bintray intergration - Open source the library