-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split client into client and transport (preelminary PR for Dark Sky integration) #74
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good I just have a few questions regarding the api surface area
* Create `OwmClient` with specified underlying `Transport` | ||
* @param transport instance of `Transport` which will do the actual sending of data | ||
*/ | ||
def basicClient[F[_]: Sync](transport: Transport[F]): OwmClient[F] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should expose this one?
* geoPrecision 1 will give ~60km infelicity if worst case; 2 ~30km etc | ||
* @param transport instance of `Transport` which will do the actual sending of data | ||
*/ | ||
def cacheClient[F[_]: Concurrent](cacheSize: Int, geoPrecision: Int, transport: Transport[F]): F[OwmCacheClient[F]] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here?
*/ | ||
case class OwmClient[F[_]: Sync](appId: String, apiHost: String = "api.openweathermap.org", ssl: Boolean = false) | ||
extends Client[F] { | ||
class OwmClient[F[_]] private[openweather] (private[openweather] val transport: Transport[F]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is transport
private[openweather]
and not just simply private
?
@BenFradet done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 merging when green
Codecov Report
@@ Coverage Diff @@
## develop #74 +/- ##
===========================================
- Coverage 78.4% 75.59% -2.81%
===========================================
Files 9 11 +2
Lines 125 127 +2
Branches 2 2
===========================================
- Hits 98 96 -2
- Misses 27 31 +4
Continue to review full report at Codecov.
|
Due to moving and splitting files around, git diff was not too kind to us, hence this PR. Could not make it smaller though.
Most important changes:
providers.openweather.OpenWeatherMap
object, constructors of these clients are package-private. This is also important because of possible changes comming with Split OWM API or make it more explicit about valid URLs #64Transport
was split from theClient
. It's similar to transport in 0.3, but contains everything needed for decoding (where transport in 0.3 returned jsons)TimeoutHttpTransport