API
//ellmental/com.theagilemonkeys.ellmental.core.api/API
API
class API<Ctx : Any>(service: KClass<Ctx>)
Constructors
API | [jvm] constructor(service: KClass<Ctx>) |
Properties
Name | Summary |
---|---|
readOperations | [jvm] var readOperations: MutableMap<String, Handler<Any, Any>> |
writeOperations | [jvm] var writeOperations: MutableMap<String, Handler<Any, Any>> |
Functions
Name | Summary |
---|---|
getName | [jvm] fun getName(): String |
read | [jvm] inline fun <I : Any, O : Any> read(name: String, noinline block: suspend (I) -> O) |
runHttp | [jvm] fun <Ctx : Any> API<Ctx>.runHttp(port: Int = 9000) |
toHttpApp | [jvm] fun <Ctx : Any> API<Ctx>.toHttpApp(port: Int = 9000): Http4kServer Converts an API to an HTTP app that is runnable with Http4kServer.start. |
write | [jvm] inline fun <I : Any, O : Any> write(name: String, noinline block: suspend (I) -> O) |