Skip to content

Commit

Permalink
Split StacClient and StreamingStacClient
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin committed May 20, 2021
1 parent 7c238b1 commit 5a4fbe1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package com.azavea.stac4s.api.client

trait StacClient[F[_]] extends StacClientF[F, SearchFilters]
trait StacClient[F[_]] extends StacClientF[F, SearchFilters]
trait StreamingStacClient[F[_], G[_]] extends StreamingStacClientF[F, G, SearchFilters]
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package com.azavea.stac4s.api.client

trait StacClient[F[_]] extends StacClientF[F, SearchFilters]
trait StacClient[F[_]] extends StacClientF[F, SearchFilters]
trait StreamingStacClient[F[_], G[_]] extends StreamingStacClientF[F, G, SearchFilters]
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ package com.azavea.stac4s.api.client
import com.azavea.stac4s._

import eu.timepit.refined.types.string.NonEmptyString
import fs2.Stream

trait StacClientF[F[_], S] {
def search: Stream[F, StacItem]
def search(filter: S): Stream[F, StacItem]
def collections: Stream[F, StacCollection]
def collection(collectionId: NonEmptyString): F[StacCollection]
def items(collectionId: NonEmptyString): Stream[F, StacItem]
def item(collectionId: NonEmptyString, itemId: NonEmptyString): F[StacItem]
def itemCreate(collectionId: NonEmptyString, item: StacItem): F[StacItem]
def collectionCreate(collection: StacCollection): F[StacCollection]
}

trait StreamingStacClientF[F[_], G[_], S] extends StacClientF[F, S] {
def search: G[StacItem]
def search(filter: S): G[StacItem]
def collections: G[StacCollection]
def items(collectionId: NonEmptyString): G[StacItem]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import sttp.model.Uri
case class SttpStacClientF[F[_]: MonadThrow, S: Encoder](
client: SttpBackend[F, Any],
baseUri: Uri
) extends StacClientF[F, S] {
) extends StreamingStacClientF[F, Stream[F, *], S] {

/** Get the next page [[Uri]] from the received [[Json]] body. */
private def getNextLink(body: Either[ResponseException[String, circe.Error], Json]): F[Option[Uri]] =
Expand Down
6 changes: 3 additions & 3 deletions project/Versions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ object Versions {
val Scapegoat = "1.4.8"
val Shapeless = "2.3.6"
val SpdxChecker = "1.0.0"
val Sttp = "3.2.3"
val SttpModel = "1.4.4"
val SttpShared = "1.2.2"
val Sttp = "3.3.4"
val SttpModel = "1.4.7"
val SttpShared = "1.2.5"
val Fs2 = "2.5.6"
val ThreeTenExtra = "1.6.0"
}

0 comments on commit 5a4fbe1

Please sign in to comment.