Package io.kvision.remote

A set of components for creating multiplatform automatic JSON-RPC connectivity with a backend server.

Types

KVServiceManager
Link copied to clipboard
open class KVServiceManager<T : Any>(serviceClass: KClass<T>) : KVServiceMgr<T>
open class KVServiceManager<T : Any>(serviceClass: KClass<T>) : KVServiceManagerJs<T> , KVServiceMgr<T>

Multiplatform service manager.

open class KVServiceManager<T : Any>(serviceClass: KClass<T>) : KVServiceBinder<T, RequestHandler, WebsocketHandler> , KVServiceMgr<T>

Multiplatform service manager for Ktor.

RequestHandler
Link copied to clipboard
typealias RequestHandler = suspend PipelineContext<Unit, ApplicationCall>.(Unit) -> Unit
WebsocketHandler
Link copied to clipboard
typealias WebsocketHandler = suspend WebSocketServerSession.() -> Unit

Functions

applyRoutes
Link copied to clipboard
fun <T : Any> Route.applyRoutes(serviceManager: KVServiceManager<T>)

A function to generate routes based on definitions from the service manager.

initStaticResources
Link copied to clipboard
fun Application.initStaticResources()

Initialize default static resources for Ktor server.

kvisionInit
Link copied to clipboard
fun Application.kvisionInit(vararg modules: Module): Injector
fun Application.kvisionInit(initStaticResources: Boolean, vararg modules: Module): Injector
fun Application.kvisionInit(initStaticResources: Boolean, json: Json, vararg modules: Module): Injector

Initialization function for Ktor server.

fun Application.kvisionInit(json: Json, vararg modules: Module): Injector

Initialization function for Ktor server with custom JsonSerializer.

Properties

injector
Link copied to clipboard
val ApplicationCall.injector: Injector
injectorKey
Link copied to clipboard
val injectorKey: AttributeKey<Injector>