KVServiceBinder

abstract class KVServiceBinder<T, RH, WH>(deSerializer: ObjectDeSerializer, routeNameGenerator: NameGenerator?)

Binds HTTP calls to kotlin functions

Parameters

T

the receiver of bound functions

RH

the platform specific request handler

WH

the platform specific websocket handler

Constructors

KVServiceBinder
Link copied to clipboard
fun KVServiceBinder(deSerializer: ObjectDeSerializer = kotlinxObjectDeSerializer(), routeNameGenerator: NameGenerator? = null)
the receiver of bound functions

Functions

bind
Link copied to clipboard
inline fun <PAR1 : Any, PAR2 : Any> bind(noinline function: suspend T.(ReceiveChannel<PAR1>, SendChannel<PAR2>) -> Unit, route: String? = null)
Binds a given web socket connection with a function of the receiver.
inline fun <RET> bind(noinline function: suspend T.() -> RET, method: HttpMethod, route: String? = null)
Binds a given route with a function of the receiver.
inline fun <PAR, RET> bind(noinline function: suspend T.(PAR) -> RET, method: HttpMethod, route: String? = null)
Binds a given route with a function of the receiver.
inline fun <PAR1, PAR2, RET> bind(noinline function: suspend T.(PAR1, PAR2) -> RET, method: HttpMethod, route: String? = null)
Binds a given route with a function of the receiver.
inline fun <PAR1, PAR2, PAR3, RET> bind(noinline function: suspend T.(PAR1, PAR2, PAR3) -> RET, method: HttpMethod, route: String? = null)
Binds a given route with a function of the receiver.
inline fun <PAR1, PAR2, PAR3, PAR4, RET> bind(noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4) -> RET, method: HttpMethod, route: String? = null)
Binds a given route with a function of the receiver.
inline fun <PAR1, PAR2, PAR3, PAR4, PAR5, RET> bind(noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4, PAR5) -> RET, method: HttpMethod, route: String? = null)
Binds a given route with a function of the receiver.
inline fun <PAR1, PAR2, PAR3, PAR4, PAR5, PAR6, RET> bind(noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4, PAR5, PAR6) -> RET, method: HttpMethod, route: String? = null)
Binds a given route with a function of the receiver.
bindTabulatorRemote
Link copied to clipboard
inline fun <RET> bindTabulatorRemote(noinline function: suspend T.(Int?, Int?, List<RemoteFilter>?, List<RemoteSorter>?, String?) -> RemoteData<RET>, route: String?)
Binds a given function of the receiver as a tabulator component source
bindWebsocket
Link copied to clipboard
fun <REQ, RES> bindWebsocket(route: String? = null, function: suspend T.(ReceiveChannel<REQ>, SendChannel<RES>) -> Unit, requestSerializer: KSerializer<REQ>, responseSerializer: KSerializer<RES>)
Binds a given web socket connection with a function of the receiver.
createRequestHandler
Link copied to clipboard
abstract fun <RET> createRequestHandler(method: HttpMethod, function: suspend T.(params: List<String?>) -> RET, serializer: KSerializer<RET>): RH
createWebsocketHandler
Link copied to clipboard
abstract fun <REQ, RES> createWebsocketHandler(function: suspend T.(ReceiveChannel<REQ>, SendChannel<RES>) -> Unit, requestSerializer: KSerializer<REQ>, responseSerializer: KSerializer<RES>): WH
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
toString
Link copied to clipboard
open fun toString(): String

Properties

deSerializer
Link copied to clipboard
val deSerializer: ObjectDeSerializer
routeMapRegistry
Link copied to clipboard
val routeMapRegistry: RouteMapRegistry<RH>
webSocketRequests
Link copied to clipboard
val webSocketRequests: MutableMap<String, WH>