This file contains 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 io.prometheus.client.CollectorRegistry | |
import io.prometheus.client.dropwizard.DropwizardExports | |
import io.prometheus.client.hotspot.DefaultExports | |
import nl.grons.metrics.scala.DefaultInstrumented | |
import akka.actor.ActorSystem | |
import akka.stream.ActorMaterializer | |
import akka.http.scaladsl.Http | |
object App extends App with DefaultInstrumented { | |
This file contains 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
package aecor.testkit | |
import aecor.data.PairE | |
import aecor.encoding.WireProtocol | |
import aecor.encoding.WireProtocol.{ Encoded, Invocation } | |
import cats.data.ReaderT | |
import cats.tagless.FunctorK | |
import cats.tagless.implicits._ | |
import cats.~> | |
import scodec.bits.BitVector |
This file contains 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.data.Kleisli | |
import cats.effect.{ Concurrent, Sync } | |
import cats.effect.concurrent.MVar | |
import cats.implicits._ | |
import cats.{ Applicative, Functor, Monad } | |
// Let's start with our dsl | |
// First we need to interact with a console | |
trait Console[F[_]] { |
This file contains 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
package aecor.runtime.akkapersistence.readside | |
import aecor.data.{ EntityEvent, Fold, Folded } | |
import aecor.runtime.Eventsourced.Versioned | |
import cats.MonadError | |
import cats.implicits._ | |
object Projection { | |
final case class ProjectionError(message: String) extends RuntimeException(message) |
This file contains 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
package aecor.kafkadistributedprocessing | |
import java.time.Duration | |
import java.util | |
import java.util.concurrent.Executors | |
import aecor.util.effect._ | |
import akka.NotUsed | |
import akka.kafka.ConsumerMessage.PartitionOffset | |
import akka.kafka.scaladsl.Consumer |
This file contains 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 akka.actor.ActorSystem | |
import akka.kafka.scaladsl.Consumer | |
import akka.kafka.{ConsumerSettings, Subscriptions} | |
import akka.stream.ActorMaterializer | |
import akka.stream.scaladsl.{Keep, Sink => AkkaSink} | |
import cats.effect.{ConcurrentEffect, ExitCode, IO, Resource} | |
import cats.implicits._ | |
import fs2.interop.reactivestreams._ | |
import org.apache.kafka.common.serialization.StringDeserializer |
This file contains 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
CREATE OR REPLACE FUNCTION auditlogfunc RETURNS TRIGGER AS $example_table$ | |
DECLARE | |
row_key JSONB; | |
affected_row JSON; | |
operation char; | |
BEGIN | |
IF TG_OP IN('INSERT', 'UPDATE') THEN | |
affected_row := row_to_json(NEW); | |
ELSE | |
affected_row := row_to_json(OLD); |
This file contains 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
/* | |
* Copyright (c) 2014-15 Denis Mikhaylov | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains 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.{ Comonad, Monad } | |
import cats.effect.{ Concurrent, Resource, Timer } | |
import cats.implicits._ | |
import scala.concurrent.duration.FiniteDuration | |
object Ex { | |
final case class Point(x: Long, y: Long) | |
final case class Direction(value: Double) |
This file contains 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.data.{ EitherT, State } | |
import cats.implicits._ | |
import cats.{ Monad, ~> } | |
import io.aecor.liberator.macros.free | |
import io.aecor.liberator.syntax._ | |
import io.aecor.liberator.{ ProductKK, Term } | |
@free | |
trait Api[F[_]] { | |
def doThing(aThing: String, params: Map[String, String]): F[Either[String, String]] |
NewerOlder