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
type Error struct { | |
Code string `json:"code"` | |
Message string `json:"message"` | |
Meta map[string]string `json:"meta"` | |
} | |
type Handler[I, O comparable] func(ctx context.Context, i I) (O, *handlers.Error) | |
func NewHandler[I, O comparable](call Handler[I, O]) http.HandlerFunc { |
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
name := "meme_keker" | |
version := "0.1" | |
scalaVersion := "2.13.1" | |
libraryDependencies += "com.typesafe.akka" % "akka-actor_2.13" % "2.5.23" | |
libraryDependencies += "com.typesafe.akka" % "akka-http_2.13" % "10.1.8" | |
libraryDependencies += "com.typesafe.akka" %% "akka-stream" % "2.6.3" |
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
package com.dennypenta.meme_keker | |
import akka.actor.ActorSystem | |
import akka.stream.ActorMaterializer | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.model.HttpRequest | |
import akka.http.scaladsl.model.HttpResponse | |
import scala.concurrent.Future | |
import scala.util.{Failure, Success} |
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
package main | |
import ( | |
"encoding" | |
"encoding/json" | |
"fmt" | |
) | |
type key struct { | |
this string |
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
type Model struct { | |
value []byte | |
} | |
func (m *Model) UnmarshalJSON(v []byte) error { | |
m.value = v | |
return nil | |
} |
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
from aiohttp.test_utils import unittest_run_loop | |
from main import Model, new_manager | |
import asyncio | |
import unittest | |
class ManagerTestCase(unittest.TestCase): | |
def setUp(self): |