This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cats._ | |
| import cats.implicits._ | |
| import fs2.Stream | |
| import org.http4s.client.Client | |
| import org.http4s.headers.{Link, LinkValue} | |
| import org.http4s.{Request, Response} | |
| object Pagination { | |
| type PaginationStrategy[F[_], S, O] = Option[S] => F[(O, Option[S])] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| abstract class H2Setup extends FlatSpecLike with BeforeAndAfterAll { | |
| val table: Update0 | |
| val insertData: ConnectionIO[Int] | |
| val h2Transactor: IO[H2Transactor[IO]] = | |
| H2Transactor[IO]("jdbc:h2:mem:users;MODE=PostgreSQL;DB_CLOSE_DELAY=-1", "sa", "") | |
| override def beforeAll(): Unit = { | |
| super.beforeAll() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| case class IO[A](unsafePerformIO: () => A) { | |
| def map[B](ab: A => B): IO[B] = IO(() => ab(unsafePerformIO())) | |
| def flatMap[B](afb: A => IO[B]): IO[B] =IO(() => afb(unsafePerformIO()).unsafePerformIO()) | |
| def tryIO(ta: Throwable => A): IO[A] = | |
| IO(() => IO.tryIO(unsafePerformIO()).unsafePerformIO() match { | |
| case Left(t) => ta(t) | |
| case Right(a) => a | |
| }) | |
| } | |
| object IO { |