Last active
January 14, 2020 09:15
-
-
Save calippo/15cd4f0204b0e8cc3e947c87315b44aa to your computer and use it in GitHub Desktop.
tapiro endpoints
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
object ControllerEndpoints { | |
def create(statusCodes: String => Int = _ => 422)( | |
implicit stringJsonCodec: JsonCodec[String], | |
listJsonCodec: JsonCodec[Result], | |
) = new DockerMonitorControllerFEndpoints { | |
override val getSomething | |
: Endpoint[String, GenericError, Result, Nothing] = | |
endpoint.get | |
.in("getContainers") | |
.in(query[String]("arg")) | |
.errorOut(jsonBody[GenericError]) | |
.out(jsonBody[Result]) | |
override val doSomething: Endpoint[ | |
Content, | |
GenericError, | |
Result, | |
Nothing | |
] = endpoint.get | |
.in("doSomething") | |
.in(jsonBody[Content]("arg")) | |
.errorOut(jsonBody[GenericError]) | |
.out(jsonBody[Result]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment